feat(docker): add healthchecks for celery-beat and node-exporter
All checks were successful
CI / pytest (push) Successful in 48m59s
CI / deploy (push) Successful in 49s
CI / ruff (push) Successful in 11s
CI / validate (push) Successful in 25s
CI / dependency-scanning (push) Successful in 29s
CI / docs (push) Successful in 41s

celery-beat: check that the schedule file was modified within the last
120 seconds (confirms beat is ticking).
node-exporter: check /metrics endpoint for build_info metric.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 23:56:56 +01:00
parent 2ca313c3c7
commit 8136739233

View File

@@ -97,7 +97,7 @@ services:
restart: always
profiles:
- full # Only start with: docker compose --profile full up -d
command: celery -A app.core.celery_config beat --loglevel=info
command: celery -A app.core.celery_config beat --loglevel=info --schedule=/tmp/celerybeat-schedule
env_file: .env
environment:
DATABASE_URL: postgresql://orion_user:secure_password@db:5432/orion_db
@@ -109,7 +109,11 @@ services:
condition: service_healthy
mem_limit: 256m
healthcheck:
disable: true
test: ["CMD-SHELL", "test $(( $(date +%s) - $(stat -c %Y /tmp/celerybeat-schedule 2>/dev/null || echo 0) )) -lt 120 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- backend
@@ -207,6 +211,11 @@ services:
- "--path.rootfs=/rootfs"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
mem_limit: 64m
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:9100/metrics | grep -q 'node_exporter_build_info' || exit 1"]
interval: 30s
timeout: 10s
retries: 3
networks:
- monitoring