From 52679bbb1afd6f8e2645beeac7490f6adcc0a5ac Mon Sep 17 00:00:00 2001 From: Kellan Drucquer Date: Sat, 4 Apr 2026 04:02:50 -0400 Subject: [PATCH] add infra healthchecks and startup ordering for docker --- deployment/docker/docker-compose.yml | 39 +++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/deployment/docker/docker-compose.yml b/deployment/docker/docker-compose.yml index 839c218..358cd70 100644 --- a/deployment/docker/docker-compose.yml +++ b/deployment/docker/docker-compose.yml @@ -11,9 +11,12 @@ x-service-common: &service-common extra_hosts: - "host.docker.internal:host-gateway" depends_on: - - nats - - clickhouse - - redis + nats: + condition: service_started + clickhouse: + condition: service_healthy + redis: + condition: service_healthy services: web: @@ -88,9 +91,12 @@ services: extra_hosts: - "host.docker.internal:host-gateway" depends_on: - - nats - - clickhouse - - redis + nats: + condition: service_started + clickhouse: + condition: service_healthy + redis: + condition: service_healthy command: ["services/ingest-options/src/index.ts"] ingest-equities: @@ -111,6 +117,16 @@ services: hard: 262144 volumes: - clickhouse-data:/var/lib/clickhouse + healthcheck: + test: + [ + "CMD-SHELL", + "wget -qO- http://127.0.0.1:8123/ping | grep -q Ok." + ] + interval: 10s + timeout: 5s + retries: 12 + start_period: 20s redis: image: redis:7.2 @@ -118,6 +134,17 @@ services: command: ["redis-server", "--appendonly", "yes"] volumes: - redis-data:/data + healthcheck: + test: + [ + "CMD", + "redis-cli", + "ping" + ] + interval: 10s + timeout: 5s + retries: 10 + start_period: 5s nats: image: nats:2.10