From ec9e3299560bed6fbc2de808cf240298359ded04 Mon Sep 17 00:00:00 2001 From: Jon Lockwood Date: Mon, 14 Feb 2022 09:25:02 +0930 Subject: [PATCH] build(docker): base image added Setup dockerfile with base components. MR !1 --- dockerfile | 22 ++++++++++++++++++ include/etc/logrotate.d/rsyslog | 23 +++++++++++++++++++ .../etc/supervisor/conf.d/supervisord.conf | 23 +++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 dockerfile create mode 100644 include/etc/logrotate.d/rsyslog create mode 100644 include/etc/supervisor/conf.d/supervisord.conf diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..3b28a31 --- /dev/null +++ b/dockerfile @@ -0,0 +1,22 @@ +FROM debian:bullseye-slim + + +# Install dependencies +RUN apt update && DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install \ + curl \ + gpg \ + gpg-agent \ + apt-transport-https \ + ca-certificates \ + supervisor + + +RUN apt update && DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install \ + # System Apps + cron \ + rsyslog \ + logrotate \ +# Cleanup, remove cron jobs not required +RUN rm -f /etc/cron.d/e2scrub_all \ + && rm -f /etc/cron.daily/apt-compat \ + && rm -f /etc/cron.daily/dpkg diff --git a/include/etc/logrotate.d/rsyslog b/include/etc/logrotate.d/rsyslog new file mode 100644 index 0000000..56c774d --- /dev/null +++ b/include/etc/logrotate.d/rsyslog @@ -0,0 +1,23 @@ +/var/log/syslog +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +/var/log/lastlog +/var/log/faillog +{ + rotate 30 + daily + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + supervisorctl restart rsyslog + endscript +} diff --git a/include/etc/supervisor/conf.d/supervisord.conf b/include/etc/supervisor/conf.d/supervisord.conf new file mode 100644 index 0000000..d06b8c6 --- /dev/null +++ b/include/etc/supervisor/conf.d/supervisord.conf @@ -0,0 +1,23 @@ +[supervisord] +#daemon=false +nodaemon = true +pidfile=/var/run/supervisord.pid + + +[program:rsyslog] +startsecs=0 +stopwaitsecs=55 +autostart=true +autorestart=true +stdout_logfile=/var/log/supervisor/%(program_name)s.log +stderr_logfile=/var/log/supervisor/%(program_name)s.log +command=/usr/sbin/rsyslogd -n + +[program:cron] +startsecs=0 +stopwaitsecs=55 +autostart=true +autorestart=true +stdout_logfile=/var/log/supervisor/%(program_name)s.log +stderr_logfile=/var/log/supervisor/%(program_name)s.log +command=/usr/sbin/cron -f