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
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user