diff --git a/README.md b/README.md index 007a3d7..53bc717 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,22 @@ The application will be available at `http://localhost:5000` ### Docker Deployment +#### Using Docker Compose (Recommended) + +1. Start the application: + +```bash +docker compose up -d +``` + +2. Stop the application: + +```bash +docker compose down +``` + +#### Using Docker Directly + 1. Build the Docker image: ```bash @@ -71,3 +87,4 @@ The application will be available at `http://localhost:5000` - `pet_pictures.db` - SQLite database (created automatically) - `Dockerfile` - Docker configuration - `.dockerignore` - Docker build exclusions +- `docker-compose.yml` - Docker Compose configuration diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..760a5c1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: "3.8" + +services: + web: + build: . + ports: + - "5000:5000" + volumes: + - ./static/uploads:/app/static/uploads + - ./pet_pictures.db:/app/pet_pictures.db + environment: + - FLASK_APP=main.py + - FLASK_ENV=production + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5000"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s