Ver Fonte

feat: add health check for pg and redis in docker-compose.middleware.yaml (#7961) (#7962)

zhuhao há 7 meses atrás
pai
commit
83e84865be
1 ficheiros alterados com 7 adições e 0 exclusões
  1. 7 0
      docker/docker-compose.middleware.yaml

+ 7 - 0
docker/docker-compose.middleware.yaml

@@ -19,6 +19,11 @@ services:
       - ./volumes/db/data:/var/lib/postgresql/data
     ports:
       - "${EXPOSE_POSTGRES_PORT:-5432}:5432"
+    healthcheck:
+      test: [ "CMD", "pg_isready" ]
+      interval: 1s
+      timeout: 3s
+      retries: 30
 
   # The redis cache.
   redis:
@@ -31,6 +36,8 @@ services:
     command: redis-server --requirepass difyai123456
     ports:
       - "${EXPOSE_REDIS_PORT:-6379}:6379"
+    healthcheck:
+      test: [ "CMD", "redis-cli", "ping" ]
 
   # The DifySandbox
   sandbox: