feat: add docker-compose configuration
This commit is contained in:
17
README.md
17
README.md
@@ -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
20
docker-compose.yml
Normal 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
|
||||||
Reference in New Issue
Block a user