2022-07-23 10:46:57 +02:00
|
|
|
FROM ubuntu:20.04
|
|
|
|
|
|
|
|
# install and configure munin
|
2022-07-23 10:54:56 +02:00
|
|
|
# hadolint ignore=DL3008
|
2022-07-23 10:53:54 +02:00
|
|
|
RUN apt-get update -qq \
|
|
|
|
DEBIAN_FRONTEND=noninteractive \
|
2022-07-23 10:54:17 +02:00
|
|
|
apt-get install -y -qq cron munin nginx apache2 wget libapache2-mod-fcgid libcgi-fast-perl ssmtp mailutils curl tzdata autoconf --no-install-recommends \
|
2022-07-23 10:53:54 +02:00
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2022-07-23 10:46:57 +02:00
|
|
|
|
2022-07-26 15:33:10 +02:00
|
|
|
RUN (cp /etc/munin/apache24.conf /etc/apache2/sites-available/000-default.conf) \
|
|
|
|
&& (sed -i 's/^Alias.*/Alias \/ \/var\/cache\/munin\/www\//g' /etc/apache2/sites-available/000-default.conf) \
|
|
|
|
&& (sed -i 's/Allow from .*/Satisfy Any/g' /etc/apache2/sites-available/000-default.conf) \
|
|
|
|
&& (sed -i 's/Order allow,deny.*/Allow from all/g' /etc/apache2/sites-available/000-default.conf) \
|
|
|
|
&& (mkdir -p /var/run/munin) \
|
|
|
|
&& (chown -R munin:munin /var/run/munin) \
|
|
|
|
&& (chfn -f 'munin' root) \
|
|
|
|
&& (/usr/sbin/a2enmod fcgid)
|
2022-07-23 10:46:57 +02:00
|
|
|
|
2022-07-26 15:33:10 +02:00
|
|
|
COPY (000-default.conf /etc/apache2/sites-available/000-default.conf)
|
|
|
|
COPY (logrotate-munin /etc/logrotate.d/munin)
|
|
|
|
COPY (munin.conf /etc/munin/munin.conf)
|
|
|
|
COPY (ssmtp.conf /etc/ssmtp/ssmtp.conf)
|
|
|
|
COPY (revaliases /etc/ssmtp/revaliases)
|
|
|
|
COPY (munin_mail.conf /etc/munin/munin-conf.d/munin_mail.conf)
|
|
|
|
COPY (slack_munin.sh /usr/local/bin/notify_slack_munin)
|
|
|
|
RUN (chmod +x /usr/local/bin/notify_slack_munin)
|
|
|
|
COPY (munin_slack.conf /etc/munin/munin-conf.d/munin_slack.conf)
|
2022-07-23 10:46:57 +02:00
|
|
|
|
|
|
|
# copy launcher
|
2022-07-23 10:53:54 +02:00
|
|
|
COPY run.sh /usr/local/bin/run
|
2022-07-23 10:46:57 +02:00
|
|
|
RUN chmod +x /usr/local/bin/run
|
|
|
|
|
|
|
|
# persist
|
|
|
|
VOLUME /var/lib/munin
|
|
|
|
VOLUME /var/log/munin
|
|
|
|
VOLUME /var/cache/munin
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
# launcher
|
|
|
|
CMD ["/usr/local/bin/run"]
|