From 0487485c06d17595e56fb53c3bc3337a614fb6fe Mon Sep 17 00:00:00 2001 From: LRVT <21357789+l4rm4nd@users.noreply.github.com> Date: Sat, 23 Mar 2024 03:13:53 +0100 Subject: [PATCH] Update docker-compose.yml add healthchecks and depends_on --- examples/ghost/docker-compose.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/ghost/docker-compose.yml b/examples/ghost/docker-compose.yml index 8c2861b..533361b 100644 --- a/examples/ghost/docker-compose.yml +++ b/examples/ghost/docker-compose.yml @@ -6,8 +6,13 @@ services: image: ghost:5-alpine container_name: ghost restart: always + depends_on: + database: + condition: service_healthy + expose: + - 2368 ports: - - 8080:2368 + - 2368:2368 volumes: - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/ghost/content:/var/lib/ghost/content environment: @@ -39,6 +44,10 @@ services: image: mysql:8 container_name: ghost_db restart: always + healthcheck: + test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p$$DB_ROOT_PASS' ] + timeout: 20s + retries: 10 volumes: - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/ghost/mysql:/var/lib/mysql expose: