From c9f95ed5a6c0b29cb3979da6a44cdf8fd0d35fa1 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 2 Jul 2026 17:20:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BD=AE=E8=BD=AC=E9=85=8D=E7=BD=AE=E5=92=8C?= =?UTF-8?q?=20Worker=20=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infra/docker/compose.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/infra/docker/compose.yml b/infra/docker/compose.yml index 77803efc1..eda34ec78 100644 --- a/infra/docker/compose.yml +++ b/infra/docker/compose.yml @@ -23,6 +23,15 @@ # - 确保 xiaoxia-net 网络已创建: docker network create xiaoxia-net # +# =========================================== +# 日志轮转配置(所有服务共享) +# =========================================== +x-logging: &default-logging + driver: json-file + options: + max-size: "50m" + max-file: "3" + services: # ========================================= # API 服务 @@ -69,6 +78,8 @@ services: retries: 3 start_period: 40s + logging: *default-logging + # ========================================= # 资源限制建议(生产环境建议启用) # ========================================= @@ -107,7 +118,17 @@ services: networks: - xiaoxia-net - + + # 健康检查配置 + healthcheck: + test: ["CMD-SHELL", "celery -A app.celery_app inspect ping --timeout 5 || exit 1"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + + logging: *default-logging + # ========================================= # 资源限制建议(生产环境建议启用) # ========================================= @@ -155,7 +176,9 @@ services: interval: 30s timeout: 5s retries: 3 - + + logging: *default-logging + # ========================================= # 资源限制建议 # =========================================