From e5fc179413040eae0a107bec3f3f71c30b38d6c8 Mon Sep 17 00:00:00 2001 From: Neha Goud Date: Sat, 4 Apr 2026 21:11:30 +0530 Subject: [PATCH] examples: add healthchecks and service_healthy depends_on to mariadb apache Closes #2250 Signed-off-by: Neha Goud --- .../insecure/mariadb/apache/compose.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.examples/docker-compose/insecure/mariadb/apache/compose.yaml b/.examples/docker-compose/insecure/mariadb/apache/compose.yaml index 6cebfa75a..e8a023719 100644 --- a/.examples/docker-compose/insecure/mariadb/apache/compose.yaml +++ b/.examples/docker-compose/insecure/mariadb/apache/compose.yaml @@ -15,12 +15,24 @@ services: - MARIADB_DISABLE_UPGRADE_BACKUP=1 env_file: - db.env + healthcheck: + test: ["CMD", "healthcheck.sh", "--innodb_initialized"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 30s # Note: Redis is an external service. You can find more information about the configuration here: # https://hub.docker.com/_/redis redis: image: redis:alpine restart: always + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 30s + timeout: 5s + retries: 5 + start_period: 10s app: image: nextcloud:apache @@ -36,8 +48,10 @@ services: env_file: - db.env depends_on: - - db - - redis + db: + condition: service_healthy + redis: + condition: service_healthy cron: image: nextcloud:apache