Skip to content

Commit 988d8a6

Browse files
MoralCodeguptapratykshhSukuna0007Abhi
committed
add health checks to rabbit and postgres to ensure they are healthy before augur starts.
This avoids some race conditions with the startup process that could create issues, especially on first initialization. Co-Authored-By: guptapratykshh <pratykshgupta9999@gmail.com> Co-Authored-By: Sukuna0007Abhi <appsonly310@gmail.com> Signed-off-by: Adrian Edwards <adredwar@redhat.com>
1 parent 8ec768d commit 988d8a6

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

docker-compose.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ services:
1414
- augurpostgres:/var/lib/postgresql/data
1515
networks:
1616
- augur
17+
healthcheck:
18+
test:
19+
[
20+
"CMD-SHELL",
21+
"pg_isready -U ${AUGUR_DB_USER:-augur} -d ${AUGUR_DB_NAME:-augur}",
22+
]
23+
interval: 10s
24+
timeout: 5s
25+
retries: 5
1726

1827
redis:
1928
image: "redis:alpine"
@@ -45,6 +54,12 @@ services:
4554
- RABBIT_MQ_DEFAULT_VHOST=${AUGUR_RABBITMQ_VHOST:-augur_vhost}
4655
networks:
4756
- augur
57+
healthcheck:
58+
test: ["CMD", "rabbitmq-diagnostics", "ping"]
59+
interval: 10s
60+
timeout: 5s
61+
retries: 10
62+
start_period: 10s
4863

4964
augur:
5065
image: augur-new:latest
@@ -78,10 +93,14 @@ services:
7893
- CACHE_LOCKDIR=/cache
7994
- CELERYBEAT_SCHEDULE_DB=/tmp/celerybeat-schedule.db
8095
depends_on:
81-
- augur-db
82-
- redis
83-
- augur-keyman
84-
- rabbitmq
96+
augur-db:
97+
condition: service_healthy
98+
redis:
99+
condition: service_started
100+
augur-keyman:
101+
condition: service_started
102+
rabbitmq:
103+
condition: service_healthy
85104
networks:
86105
- augur
87106
user: 2345:2345 # Run as an arbitrary non-root user

0 commit comments

Comments
 (0)