diff --git a/Dockerfile b/Dockerfile index 0ec8bc49..c081c140 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/delete_large_logs b/delete_large_logs new file mode 100755 index 00000000..9f85b734 --- /dev/null +++ b/delete_large_logs @@ -0,0 +1,2 @@ +#!/bin/sh +find /var/log/gunicorn/ -size +10000000k -type f -delete