Browse Source

fix: 3个服务的健康检测

大侠咬超人 6 days ago
parent
commit
01688f7a19
1 changed files with 14 additions and 0 deletions
  1. 14 0
      docker-compose.yml

+ 14 - 0
docker-compose.yml

@@ -30,6 +30,13 @@ services:
       - ./storage:/app/storage
       - ./.env:/app/.env
     restart: unless-stopped
+    # 队列 worker 健康检查:检查进程是否存在
+    healthcheck:
+      test: ["CMD-SHELL", "pgrep -f 'queue:work' || exit 1"]
+      interval: 30s
+      timeout: 10s
+      retries: 3
+      start_period: 10s
     deploy:
       resources:
         limits:
@@ -47,6 +54,13 @@ services:
       - ./storage:/app/storage
       - ./.env:/app/.env
     restart: unless-stopped
+    # PDF worker 健康检查:检查进程是否存在
+    healthcheck:
+      test: ["CMD-SHELL", "pgrep -f 'queue:work' || exit 1"]
+      interval: 30s
+      timeout: 10s
+      retries: 3
+      start_period: 10s
     deploy:
       resources:
         limits: