add infra healthchecks and startup ordering for docker
This commit is contained in:
parent
7babd4fce7
commit
52679bbb1a
1 changed files with 33 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue