Skip to content

Commit 2f55f84

Browse files
committed
Add healthcheck to rabbit container
1 parent ad47fb4 commit 2f55f84

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

docker-compose.override.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ services:
1010
- RABBITMQ_DEFAULT_USER=user
1111
- RABBITMQ_DEFAULT_PASS=password
1212
- RABBITMQ_ERLANG_COOKIE='d53f219cd9376f8f440aaf9889f315ab'
13+
healthcheck:
14+
test: rabbitmq-diagnostics check_port_connectivity
15+
interval: 1s
16+
timeout: 3s
17+
retries: 30
1318

1419
node:
1520
image: node:20

docker-compose.server.override.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ services:
1111
- "RABBITMQ_ERLANG_COOKIE=${RABBITMQ_ERLANG_COOKIE}"
1212
volumes:
1313
- ".docker/data/rabbitmq:/var/lib/rabbitmq/mnesia/"
14+
healthcheck:
15+
test: rabbitmq-diagnostics check_port_connectivity
16+
interval: 1s
17+
timeout: 3s
18+
retries: 30
1419

1520
supervisor:
1621
image: itkdev/supervisor-php8.4:alpine
@@ -28,8 +33,10 @@ services:
2833
volumes:
2934
- .:/app
3035
depends_on:
31-
- rabbit
36+
rabbit:
37+
condition: service_healthy
3238

3339
phpfpm:
3440
depends_on:
35-
- rabbit
41+
rabbit:
42+
condition: service_healthy

0 commit comments

Comments
 (0)