From e2c894f87f1848df3b056eee322860247791ca3c Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 10 Apr 2024 09:23:48 +0530 Subject: [PATCH] [infra] Limit the maximum size of the nginx stdout logs nginx logs to stdout, which is captured by docker and put into a file at /var/lib/docker/containers//-json.log By default, the size of this file is unbounded. Add a maximum limit of 1 GB to this. References: - https://docs.docker.com/config/containers/logging/local/ - https://stackoverflow.com/questions/31829587/docker-container-logs-taking-all-my-disk-space --- infra/services/nginx/nginx.service | 1 + 1 file changed, 1 insertion(+) diff --git a/infra/services/nginx/nginx.service b/infra/services/nginx/nginx.service index e14e7840d..4951c5e75 100644 --- a/infra/services/nginx/nginx.service +++ b/infra/services/nginx/nginx.service @@ -16,5 +16,6 @@ ExecStart=docker run --name nginx \ -v /root/nginx/cert.pem:/etc/ssl/certs/cert.pem:ro \ -v /root/nginx/key.pem:/etc/ssl/private/key.pem:ro \ -v /root/nginx/conf.d:/etc/nginx/conf.d:ro \ + --log-opt max-size=1g \ nginx ExecReload=docker exec nginx nginx -s reload