54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
web:
|
|
build: .
|
|
command: gunicorn --bind 0.0.0.0:5000 app:app
|
|
ports:
|
|
- "10335:5000"
|
|
environment:
|
|
- FLASK_APP=app.py
|
|
- FLASK_ENV=production
|
|
- DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_DB=docupulse
|
|
volumes:
|
|
- docupulse_uploads:/app/uploads
|
|
depends_on:
|
|
- db
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 40s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '1'
|
|
memory: 1G
|
|
|
|
db:
|
|
image: postgres:13
|
|
environment:
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_DB=docupulse
|
|
volumes:
|
|
- docupulse_postgres_data:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
volumes:
|
|
docupulse_postgres_data:
|
|
name: docupulse_${COMPOSE_PROJECT_NAME:-default}_postgres_data
|
|
driver: local
|
|
docupulse_uploads:
|
|
name: docupulse_${COMPOSE_PROJECT_NAME:-default}_uploads
|
|
driver: local |