Skip to content

Commit e5fc179

Browse files
committed
examples: add healthchecks and service_healthy depends_on to mariadb apache
Closes #2250 Signed-off-by: Neha Goud <nehagoud300@gmail.com>
1 parent 17c2c59 commit e5fc179

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

  • .examples/docker-compose/insecure/mariadb/apache

.examples/docker-compose/insecure/mariadb/apache/compose.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,24 @@ services:
1515
- MARIADB_DISABLE_UPGRADE_BACKUP=1
1616
env_file:
1717
- db.env
18+
healthcheck:
19+
test: ["CMD", "healthcheck.sh", "--innodb_initialized"]
20+
interval: 30s
21+
timeout: 10s
22+
retries: 5
23+
start_period: 30s
1824

1925
# Note: Redis is an external service. You can find more information about the configuration here:
2026
# https://hub.docker.com/_/redis
2127
redis:
2228
image: redis:alpine
2329
restart: always
30+
healthcheck:
31+
test: ["CMD", "redis-cli", "ping"]
32+
interval: 30s
33+
timeout: 5s
34+
retries: 5
35+
start_period: 10s
2436

2537
app:
2638
image: nextcloud:apache
@@ -36,8 +48,10 @@ services:
3648
env_file:
3749
- db.env
3850
depends_on:
39-
- db
40-
- redis
51+
db:
52+
condition: service_healthy
53+
redis:
54+
condition: service_healthy
4155

4256
cron:
4357
image: nextcloud:apache

0 commit comments

Comments
 (0)