Skip to content

Commit 1622367

Browse files
committed
feat: add redis healthcheck and make backend & worker depend on it
1 parent 47a3013 commit 1622367

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

compose.base.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,17 @@ services:
5959
depends_on:
6060
migrations:
6161
condition: service_completed_successfully
62+
redis:
63+
condition: service_healthy
6264
worker:
6365
<<: *default-api
6466
command: worker
6567
restart: always
6668
depends_on:
6769
migrations:
6870
condition: service_completed_successfully
71+
redis:
72+
condition: service_healthy
6973
deploy:
7074
mode: replicated
7175
replicas: ${WORKER_REPLICAS:-3}

compose.cache.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@ services:
1616
- REDIS_DATABASES=1
1717
networks:
1818
openimis-net:
19+
healthcheck:
20+
test: ["CMD", "redis-cli", "-a", "$$REDIS_PASSWORD", "ping"]
21+
interval: 5s
22+
timeout: 3s
23+
retries: 5
1924
volumes:
20-
redis-database:
25+
redis-database:

0 commit comments

Comments
 (0)