Features: 1) Add healthcheck for celery worker service in docker-compose; 2) Add dependent services with healthcheck conditions for beat.

Fixes: n/a;

Extra: n/a;
This commit is contained in:
Egor Pavlovich Gorbunov 2025-07-02 01:34:08 +03:00
parent ed4d761741
commit ea92c67373

View file

@ -169,6 +169,12 @@ services:
elasticsearch: elasticsearch:
condition: service_healthy condition: service_healthy
logging: *default-logging logging: *default-logging
healthcheck:
test: [ "CMD-SHELL", "celery -A evibes status | grep -q 'OK'" ]
interval: 30s
timeout: 10s
retries: 5
start_period: 15s
beat: beat:
container_name: beat container_name: beat
@ -186,6 +192,10 @@ services:
depends_on: depends_on:
worker: worker:
condition: service_healthy condition: service_healthy
stock_updater:
condition: service_healthy
database:
condition: service_healthy
logging: *default-logging logging: *default-logging
healthcheck: healthcheck:
test: [ "CMD", "bash", "-c", "pgrep -f 'celery beat' >/dev/null" ] test: [ "CMD", "bash", "-c", "pgrep -f 'celery beat' >/dev/null" ]