host/compose.yaml
Andros Fenollosa ed1bc20076 Replace Django healthcheck with lightweight HTTP probe
manage.py check booted a full Django interpreter every 30s (~1.5s CPU
per run) and never verified the server was actually responding. Probe
the HTTP endpoint directly instead and relax the interval.
2026-07-04 19:39:32 +02:00

69 lines
1.5 KiB
YAML

services:
redis:
image: redis:8-alpine
restart: unless-stopped
expose:
- "6379"
volumes:
- ./redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
django:
build: .
restart: unless-stopped
expose:
- "8000"
env_file:
- .env
depends_on:
redis:
condition: service_healthy
volumes:
- .:/app
- ./storage:/app/storage
command: ./entrypoint.sh
healthcheck:
test: ["CMD", "python3", "-c", "import http.client; c=http.client.HTTPConnection('localhost',8000,timeout=5); c.request('GET','/'); exit(0 if c.getresponse().status<400 else 1)"]
interval: 2m
timeout: 10s
retries: 3
start_period: 40s
huey:
build: .
env_file:
- .env
depends_on:
redis:
condition: service_healthy
django:
condition: service_healthy
volumes:
- .:/app
- ./storage:/app/storage
command: python manage.py run_huey
restart: unless-stopped
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "${NGINX_PORT:-8080}:80"
env_file:
- .env
depends_on:
django:
condition: service_healthy
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./storage:/app/storage:ro
- ./staticfiles:/app/staticfiles:ro
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 30s
timeout: 10s
retries: 3