Ajout d'un logrotate pour les logs de nginx

This commit is contained in:
Jean-Marie Favreau
2025-04-28 12:05:06 +02:00
parent bfcc23c133
commit c3fbaac385
5 changed files with 42 additions and 5 deletions

View File

@@ -0,0 +1,18 @@
FROM nginx:latest
RUN apt-get update && \
apt-get install -y logrotate cron && \
rm -rf /var/lib/apt/lists/*
RUN rm -f /var/log/nginx/access.log /var/log/nginx/error.log
RUN chmod 755 /var/log/nginx
RUN chown root:nginx /var/log/nginx
COPY deployment/scripts/nginx/nginx.logrotate /etc/logrotate.d/nginx
RUN chmod 644 /etc/logrotate.d/nginx
COPY deployment/scripts/nginx/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
CMD ["/entrypoint.sh"]