chore(forgejo): ограничить размер json-лога контейнера
All checks were successful
CI Trade-In / changes (pull_request) Successful in 12s
CI Trade-In / backend-tests (pull_request) Has been skipped
CI Trade-In / browser-tests (pull_request) Has been skipped
CI Trade-In / frontend-checks (pull_request) Has been skipped
CI / changes (pull_request) Successful in 16s
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 2m56s
CI / backend-tests (pull_request) Successful in 7m11s
All checks were successful
CI Trade-In / changes (pull_request) Successful in 12s
CI Trade-In / backend-tests (pull_request) Has been skipped
CI Trade-In / browser-tests (pull_request) Has been skipped
CI Trade-In / frontend-checks (pull_request) Has been skipped
CI / changes (pull_request) Successful in 16s
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 2m56s
CI / backend-tests (pull_request) Successful in 7m11s
Лог контейнера forgejo дорос до 3.35 ГиБ за 23 дня (~150 МБ/сутки) — крупнейший файл логов на хосте, на два порядка больше любого другого. Драйвер json-file не ротирует ничего без явных опций, а глобального /etc/docker/daemon.json на этой VM нет вообще. 50m x 3 = потолок 150 МБ. Пересоздание контейнера при применении настроек заодно удаляет старый безлимитный файл.
This commit is contained in:
parent
d633c0d1c3
commit
6f67ed3737
1 changed files with 12 additions and 0 deletions
|
|
@ -70,6 +70,18 @@ services:
|
|||
FORGEJO__security__INSTALL_LOCK: "true"
|
||||
volumes:
|
||||
- ./data/forgejo:/data
|
||||
# Container log cap. Measured 2026-09-17: this container's json log had
|
||||
# grown to 3.35 GiB in 23 days (~150 MB/day) with no rotation at all,
|
||||
# the single largest log on the host by two orders of magnitude. Docker's
|
||||
# json-file driver never rotates unless told to, and there is no
|
||||
# /etc/docker/daemon.json on this VM to set a global default. 50m x 3
|
||||
# caps this container at 150 MB; recreating it also drops the old
|
||||
# unbounded file.
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "50m"
|
||||
max-file: "3"
|
||||
ports:
|
||||
- "2222:22"
|
||||
networks:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue