From 8b644435590037e417aa90e17873c54a79b9e320 Mon Sep 17 00:00:00 2001 From: AkagiYui Date: Sun, 25 Aug 2024 11:56:34 +0800 Subject: [PATCH] chore: add condition check in docker compose --- docker-compose.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 98ff826..907aa07 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,8 +10,10 @@ services: - /srv/kenko-drive/data:/app/data restart: always depends_on: - - redis - - mysql + redis: + condition: service_healthy + mysql: + condition: service_healthy redis: image: redis:7-alpine @@ -20,6 +22,11 @@ services: ports: - "6677:6677" restart: always + healthcheck: + test: [ "CMD", "redis-cli", "ping" ] + interval: 10s + timeout: 5s + retries: 3 mysql: image: mysql:8 @@ -32,6 +39,9 @@ services: volumes: - /srv/kenko-drive/mysql/data:/var/lib/mysql restart: always + healthcheck: + test: [ "CMD", "mysql", "-uroot", "-proot", "-e", "SELECT 1" ] + interval: 10s minio: image: minio/minio