[infra] Limit the maximum size of the nginx stdout logs (#1395)

nginx logs to stdout, which is captured by docker and put into a file at
`/var/lib/docker/containers/<nginx-cont-id>/<id>-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
This commit is contained in:
Manav Rathi 2024-04-10 09:41:05 +05:30 committed by GitHub
commit f893f12f26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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