feat(docker): add healthchecks for celery-beat and node-exporter
All checks were successful
All checks were successful
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:
@@ -97,7 +97,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
profiles:
|
profiles:
|
||||||
- full # Only start with: docker compose --profile full up -d
|
- 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
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: postgresql://orion_user:secure_password@db:5432/orion_db
|
DATABASE_URL: postgresql://orion_user:secure_password@db:5432/orion_db
|
||||||
@@ -109,7 +109,11 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
mem_limit: 256m
|
mem_limit: 256m
|
||||||
healthcheck:
|
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:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
@@ -207,6 +211,11 @@ services:
|
|||||||
- "--path.rootfs=/rootfs"
|
- "--path.rootfs=/rootfs"
|
||||||
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
|
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
|
||||||
mem_limit: 64m
|
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:
|
networks:
|
||||||
- monitoring
|
- monitoring
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user