From 6468a019146b85e1fc952a5f8b09def0cfff6607 Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Tue, 20 Sep 2022 11:23:37 +0200 Subject: [PATCH] added logrotate and crond entrypoint --- docker/Dockerfile | 6 +++++- docker/logrotate-cron | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 docker/logrotate-cron diff --git a/docker/Dockerfile b/docker/Dockerfile index f626f3a..7c7cda6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,9 @@ FROM alpine:3.16 + +COPY logrotate-cron /etc/logrotate.d + RUN \ - apk -U add python3 py3-pip py3-requests py3-dateutil py3-beautifulsoup4 && \ + apk -U add python3 py3-pip py3-requests py3-dateutil py3-beautifulsoup4 logrotate && \ pip3 install fdb mysql-connector-python==8.0.29 telepot caldav +ENTRYPOINT ["/usr/sbin/crond", "-f", "-d8", "-L", "/var/log/cron.log"] diff --git a/docker/logrotate-cron b/docker/logrotate-cron new file mode 100644 index 0000000..094540a --- /dev/null +++ b/docker/logrotate-cron @@ -0,0 +1,8 @@ +/var/log/cron.log { + rotate 4 + compress + delaycompress + missingok + notifempty + sharedscripts +} \ No newline at end of file