54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
# PX360 — PROD compose for `target deploy` (external PostgreSQL, bundled redis)
|
|
#
|
|
# Same injection rules as compose.dev.yml: web service must be named `web_app`,
|
|
# target adds container_name + networks and removes ports.
|
|
#
|
|
# The database is EXTERNAL (managed elsewhere). DATABASE_URL (in .env) is used by
|
|
# Django; DB_HOST/DB_PORT/DB_USER (in .env) are used by the entrypoint's pg_isready.
|
|
#
|
|
# env file (in the deploy dir ~/.target/hh-prod/):
|
|
# .env — ALL config + secrets, shipped by `target deploy` (deploy/env.prod)
|
|
services:
|
|
web_app:
|
|
image: {{ .ImageTag }}
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- media_volume:/app/media
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
|
|
celery:
|
|
image: {{ .ImageTag }}
|
|
restart: unless-stopped
|
|
command: celery -A config worker -l info --concurrency=4
|
|
env_file:
|
|
- .env
|
|
|
|
celery-beat:
|
|
image: {{ .ImageTag }}
|
|
restart: unless-stopped
|
|
command: celery -A config beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
|
|
env_file:
|
|
- .env
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
restart: unless-stopped
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
redis_data:
|
|
media_volume:
|