services: web: build: . command: ./start.sh 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 - REDIS_URL=redis://redis:6379/0 volumes: - uploads:/data depends_on: db: condition: service_healthy redis: condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5000/health"] interval: 30s timeout: 10s retries: 3 deploy: resources: limits: cpus: '1' memory: 1G db: image: postgres:13 environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=docupulse volumes: - postgres_data:/var/lib/postgresql/data restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 30s timeout: 10s retries: 3 redis: image: redis:7 ports: - "6379:6379" restart: unless-stopped healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 30s timeout: 10s retries: 3 celery_worker: build: . command: celery -A celery_worker.celery worker --loglevel=info volumes: - .:/app environment: - FLASK_APP=app.py - FLASK_ENV=development - DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse - REDIS_URL=redis://redis:6379/0 depends_on: db: condition: service_healthy redis: condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "celery", "-A", "celery_worker.celery", "inspect", "ping"] interval: 30s timeout: 10s retries: 3 deploy: resources: limits: cpus: '0.5' memory: 512M volumes: postgres_data: uploads: