79 lines
2.0 KiB
YAML
79 lines
2.0 KiB
YAML
# PX360 — DEV compose for `target deploy` (bundled postgres + redis)
|
|
#
|
|
# target injects into the `web_app` service on deploy:
|
|
# - container_name: <app>-web_app (so the shared Caddy can route to it)
|
|
# - networks: [target-proxy, default]
|
|
# - removes any `ports:` (the shared Caddy handles ingress)
|
|
#
|
|
# The web service MUST be named `web_app` — target's Caddy injection looks for it.
|
|
# `{{ .ImageTag }}` is replaced by target with the freshly built image tag.
|
|
#
|
|
# env file (in the deploy dir ~/.target/hh-dev/):
|
|
# .env — ALL config + secrets, shipped by `target deploy` (deploy/env.dev)
|
|
services:
|
|
web_app:
|
|
image: {{ .ImageTag }}
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- media_volume:/app/media
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
ports:
|
|
- "8000:8000"
|
|
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=2
|
|
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
|
|
|
|
db:
|
|
image: postgres:15-alpine
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5432:5432"
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- pg_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-px360}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
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:
|
|
pg_data:
|
|
redis_data:
|
|
media_volume:
|