version: '3' services: app: build: context: .. dockerfile: config/Dockerfile command: gunicorn -w 4 -b :8000 "app:create_app()" --access-logfile - --error-logfile - volumes: - ../app:/app/app environment: - FLASK_APP=app - FLASK_ENV=production - DATABASE_URL=postgresql://user:password@db:5432/app_db - REDIS_URL=redis://redis:6379/0 - SECRET_KEY=${SECRET_KEY:-default_secret_key_change_in_production} depends_on: - db - redis restart: unless-stopped nginx: image: nginx:1.25 ports: - "80:80" - "443:443" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/conf.d:/etc/nginx/conf.d - ./nginx/ssl:/etc/nginx/ssl depends_on: - app restart: unless-stopped db: image: postgres:15 environment: POSTGRES_USER: user POSTGRES_PASSWORD: password POSTGRES_DB: app_db volumes: - pg_data:/var/lib/postgresql/data restart: unless-stopped redis: image: redis:7 volumes: - redis_data:/data restart: unless-stopped volumes: pg_data: redis_data: