chore: add Docker log rotation to all production services
- Add json-file log driver with rotation to all 4 services - Backend/frontend: max-size 50m, max-file 5 - PostgreSQL: max-size 30m, max-file 3 - Redis: max-size 20m, max-file 3 - Prevents disk exhaustion from unbounded container logs
This commit is contained in:
parent
6b90fb5cd6
commit
66e4bff60d
|
|
@ -33,6 +33,11 @@ services:
|
|||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "30m"
|
||||
max-file: "3"
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
|
|
@ -59,6 +64,11 @@ services:
|
|||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 15s
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "20m"
|
||||
max-file: "3"
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
|
|
@ -93,6 +103,12 @@ services:
|
|||
retries: 3
|
||||
start_period: 30s
|
||||
# 使用 Dockerfile 中定义的 gunicorn 启动命令
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "50m"
|
||||
max-file: "5"
|
||||
tag: "geo-backend"
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
|
|
@ -124,6 +140,12 @@ services:
|
|||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "50m"
|
||||
max-file: "5"
|
||||
tag: "geo-frontend"
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
|
|
|
|||
Loading…
Reference in New Issue