fix: add proper healthchecks for Celery containers

Celery containers inherited the HTTP healthcheck from the Dockerfile
but don't run a web server. Added celery inspect ping for the worker
and schedule file check for beat.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-02-21 18:30:11 -07:00
parent 91bb60c130
commit c4ac33bd7c
1 changed files with 12 additions and 0 deletions

View File

@ -121,6 +121,12 @@ services:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "celery -A config inspect ping --timeout 10 | grep -q 'pong'"]
interval: 30s
timeout: 15s
start_period: 40s
retries: 3
cap_drop:
- ALL
security_opt:
@ -146,6 +152,12 @@ services:
- SECRET_KEY=${SECRET_KEY}
depends_on:
- celery-worker
healthcheck:
test: ["CMD-SHELL", "test -f /tmp/celerybeat-schedule"]
interval: 30s
timeout: 5s
start_period: 40s
retries: 3
cap_drop:
- ALL
security_opt: