feat: add docker-compose configuration

This commit is contained in:
Ryan Chen
2025-06-13 16:56:08 -04:00
parent 57b1bb3ddd
commit febb1b67f6
2 changed files with 37 additions and 0 deletions

View File

@@ -31,6 +31,22 @@ The application will be available at `http://localhost:5000`
### Docker Deployment ### 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: 1. Build the Docker image:
```bash ```bash
@@ -71,3 +87,4 @@ The application will be available at `http://localhost:5000`
- `pet_pictures.db` - SQLite database (created automatically) - `pet_pictures.db` - SQLite database (created automatically)
- `Dockerfile` - Docker configuration - `Dockerfile` - Docker configuration
- `.dockerignore` - Docker build exclusions - `.dockerignore` - Docker build exclusions
- `docker-compose.yml` - Docker Compose configuration

20
docker-compose.yml Normal file
View File

@@ -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