From 6da59da93488af7558810d239ea82df25c85c572 Mon Sep 17 00:00:00 2001 From: Mavis Date: Tue, 9 Jun 2026 10:52:51 +0800 Subject: [PATCH] =?UTF-8?q?chore(docker):=20=E6=89=80=E6=9C=89=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E5=8A=A0=20logging=20rotation(max-size=2010m,=20max-f?= =?UTF-8?q?ile=203,=20=E6=80=BB=2030MB/=E5=AE=B9=E5=99=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index da1bdb0..23c5233 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,11 @@ services: # 不暴露到宿主机 expose: - "5432" + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" redis: image: redis:7-alpine @@ -33,6 +38,11 @@ services: retries: 5 expose: - "6379" + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" api: build: @@ -50,6 +60,11 @@ services: volumes: - ./backend/app:/app/app command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" worker: build: @@ -65,6 +80,11 @@ services: volumes: - ./backend/app:/app/app command: ["python", "-m", "app.workers"] + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" caddy: image: caddy:2-alpine @@ -79,6 +99,11 @@ services: - caddy_config:/config depends_on: - api + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" frontend: build: @@ -91,6 +116,11 @@ services: - "80" depends_on: - api + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" volumes: pg_data: