====== Logging ======
Prevent disc space flooding with container logs:
* [[https://willsena.dev/strategies-for-rotating-docker-logs/|Strategies for Rotating Docker Logs]]
* [[https://www.paulsblog.dev/how-to-manage-docker-logfiles-with-logrotate/|How To Manage Docker Logfiles with Logrotate]]
* [[https://alexanderzeitler.com/articles/rotating-nginx-logs-with-docker-compose/|Rotating nginx logs using Docker Compose and logrotate]]
/var/lib/docker/containers/*/*.log {
rotate 4
weekly
compress
size=100M
missingok
delaycompress
copytruncate
}
===== nginx logs =====
/srv/nginx/logs/*.log {
weekly
missingok
rotate 4
dateext
compress
delaycompress
notifempty
sharedscripts
postrotate
cd /root/dockers/nginx \
&& /usr/local/bin/docker-compose kill -s USR1 nginx
endscript
}