Skip to content

Commit

Permalink
Merge pull request #724 from IATI/fix/delete-large-logs
Browse files Browse the repository at this point in the history
Fix | Delete gunicorn logs >10G to avoid running out of disk space
  • Loading branch information
Bjwebb authored Aug 16, 2023
2 parents bcdaa10 + bffdd23 commit 4cf7be7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ EXPOSE 5000
RUN mkdir -p /var/log/gunicorn
RUN chmod 644 /var/log/gunicorn
RUN touch /var/log/gunicorn/gunicorn.log
COPY delete_large_logs /etc/periodic/15min/delete_large_logs
ENTRYPOINT ["/usr/src/app/entrypoint.sh"]
CMD ["tail", "-n", "+0", "-f", "/var/log/gunicorn/gunicorn.log"]
2 changes: 2 additions & 0 deletions delete_large_logs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
find /var/log/gunicorn/ -size +10000000k -type f -delete

0 comments on commit 4cf7be7

Please sign in to comment.