From c697ec99440dbb47461246a9b69cfd9fb0c76a54 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 2 Jul 2026 17:22:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20infra.yml=20=E7=AB=AF=E5=8F=A3=E7=BB=91?= =?UTF-8?q?=E5=AE=9A127.0.0.1=E3=80=81healthcheck=E9=97=B4=E9=9A=94?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=BA30s=E3=80=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BD=AE=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infra/docker/infra.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/infra/docker/infra.yml b/infra/docker/infra.yml index 13602c7ca..bea79a591 100644 --- a/infra/docker/infra.yml +++ b/infra/docker/infra.yml @@ -1,5 +1,14 @@ version: '3.8' +# =========================================== +# 日志轮转配置(所有服务共享) +# =========================================== +x-logging: &default-logging + driver: json-file + options: + max-size: "50m" + max-file: "3" + services: postgres: image: postgres:16 @@ -10,14 +19,15 @@ services: POSTGRES_USER: xiaoxia POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme_in_production} ports: - - "5432:5432" + - "127.0.0.1:5432:5432" volumes: - postgres_data:/var/lib/postgresql/data networks: - xiaoxia-net + logging: *default-logging healthcheck: test: ["CMD-SHELL", "pg_isready -U xiaoxia"] - interval: 10s + interval: 30s timeout: 5s retries: 5 @@ -26,14 +36,15 @@ services: container_name: xiaoxia-redis restart: always ports: - - "6379:6379" + - "127.0.0.1:6379:6379" volumes: - redis_data:/data networks: - xiaoxia-net + logging: *default-logging healthcheck: test: ["CMD", "redis-cli", "ping"] - interval: 10s + interval: 30s timeout: 3s retries: 5