2022-07-23 10:46:57 +02:00
|
|
|
FROM ubuntu:20.04
|
|
|
|
|
|
|
|
# install and configure munin
|
2022-08-06 20:28:30 +02:00
|
|
|
# hadolint ignore=DL3008
|
|
|
|
|
|
|
|
# hadolint ignore=DL3008
|
|
|
|
RUN apt-get update && \
|
2022-08-06 20:33:28 +02:00
|
|
|
RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
|
2022-08-06 20:28:30 +02:00
|
|
|
cron \
|
|
|
|
munin \
|
|
|
|
nginx \
|
|
|
|
apache2 \
|
|
|
|
wget \
|
|
|
|
libapache2-mod-fcgid \
|
|
|
|
libcgi-fast-perl \
|
|
|
|
ssmtp \
|
2023-04-16 15:02:42 +02:00
|
|
|
perl \
|
2022-08-06 20:28:30 +02:00
|
|
|
mailutils \
|
|
|
|
curl tzdata \
|
2023-04-16 14:58:22 +02:00
|
|
|
munin-node \
|
2022-08-06 20:28:49 +02:00
|
|
|
autoconf \
|
2022-08-06 20:28:30 +02:00
|
|
|
&& apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*
|
|
|
|
|
2023-04-16 15:12:10 +02:00
|
|
|
COPY run.sh /usr/local/bin/run
|
2023-04-16 15:07:18 +02:00
|
|
|
COPY munin_stats /etc/munin/plugins/munin_stats
|
|
|
|
COPY munin_update /etc/munin/plugins/munin_update
|
|
|
|
|
2022-08-06 20:30:27 +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) && \
|
2023-04-16 15:11:02 +02:00
|
|
|
(sed -i 's/Allow from .*/Satisfy Any/g' /etc/apache2/sites-available/000-default.conf) && \
|
2022-08-06 20:30:27 +02:00
|
|
|
(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) && \
|
2023-04-16 15:11:02 +02:00
|
|
|
(/usr/sbin/a2enmod fcgid) && \
|
|
|
|
rm -rf /etc/munin/plugins && \
|
2023-04-16 15:13:14 +02:00
|
|
|
mkdir -p /etc/munin/plugins && \
|
2023-04-16 15:11:02 +02:00
|
|
|
chmod +x /etc/munin/plugins/munin_stats && \
|
2023-04-16 15:12:10 +02:00
|
|
|
chmod +x /etc/munin/plugins/munin_update && \
|
|
|
|
chmod +x /usr/local/bin/run
|
2023-04-16 14:58:22 +02:00
|
|
|
|
2022-07-26 15:40:46 +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
|
2022-07-23 10:46:57 +02:00
|
|
|
|
|
|
|
# persist
|
|
|
|
VOLUME /var/lib/munin
|
|
|
|
VOLUME /var/log/munin
|
|
|
|
VOLUME /var/cache/munin
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
2023-04-16 14:16:31 +02:00
|
|
|
# health check
|
|
|
|
HEALTHCHECK --interval=5m --timeout=3s \
|
|
|
|
CMD curl -f http://localhost/munin/ || exit 1
|
|
|
|
|
2022-07-23 10:46:57 +02:00
|
|
|
# launcher
|
|
|
|
CMD ["/usr/local/bin/run"]
|