name: qrme services: db: image: postgres:16 environment: POSTGRES_DB: qrme POSTGRES_USER: qrme POSTGRES_PASSWORD: qrme volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U qrme"] interval: 5s timeout: 3s retries: 10 redis: image: redis:7 healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 10 web: build: . command: sh -c "python manage.py migrate && gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 2 --reload" env_file: .env volumes: - .:/app depends_on: db: condition: service_healthy redis: condition: service_healthy healthcheck: test: ["CMD", "curl", "-fsS", "http://localhost:8000/healthz"] interval: 10s timeout: 5s retries: 5 start_period: 30s worker: build: . command: celery -A config worker --loglevel=info env_file: .env volumes: - .:/app depends_on: db: condition: service_healthy redis: condition: service_healthy beat: build: . command: celery -A config beat --loglevel=info env_file: .env volumes: - .:/app depends_on: redis: condition: service_healthy flower: build: . command: celery -A config flower --port=5555 env_file: .env ports: - "5555:5555" depends_on: redis: condition: service_healthy profiles: [monitoring] nginx: image: nginx:1.27-alpine ports: - "8080:80" environment: MAX_UPLOAD_MB: ${MAX_UPLOAD_MB:-15} volumes: - ./nginx/default.conf.template:/etc/nginx/templates/default.conf.template:ro - ./static:/srv/static:ro depends_on: web: condition: service_healthy volumes: postgres_data: