From ac1ea2e1c9651c092246a24768d1433c193a095f Mon Sep 17 00:00:00 2001 From: Color2333 <1552429809@qq.com> Date: Sat, 18 Jul 2026 21:39:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(worker):=20=E6=98=BE=E5=BC=8F=E7=A6=81?= =?UTF-8?q?=E7=94=A8=20worker=20healthcheck=EF=BC=88Dockerfile=20=E7=BB=A7?= =?UTF-8?q?=E6=89=BF=E5=AF=BC=E8=87=B4=E8=AF=AF=E5=88=A4=20unhealthy?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #54 删了 compose 里 worker 的 healthcheck,但 worker 共用 Dockerfile.backend,该 Dockerfile 有 HEALTHCHECK curl 8000/health (给 backend 用)。删 compose healthcheck 后 worker 继承了 Dockerfile 的 healthcheck,但 worker 不跑 uvicorn,curl 8000 必失败 → worker 一直 unhealthy。 修复:compose worker 段加 healthcheck: test: ["NONE"] 显式禁用 (覆盖 Dockerfile 继承的 healthcheck),backend 的 Dockerfile HEALTHCHECK 不变。 --- docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b6e6298..e1bf6a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,6 +79,10 @@ services: condition: service_started postgres: condition: service_healthy + # worker 共用 Dockerfile.backend(含 HEALTHCHECK curl 8000/health),但 worker + # 不跑 uvicorn,继承的 healthcheck 会误判 unhealthy。显式禁用 worker healthcheck。 + healthcheck: + test: ["NONE"] deploy: resources: limits: