This repository has been archived on 2024-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
munin-server/Dockerfile
2023-04-16 15:07:18 +02:00

63 lines
1.8 KiB
Docker

FROM ubuntu:20.04
# install and configure munin
# hadolint ignore=DL3008
# hadolint ignore=DL3008
RUN apt-get update && \
RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
cron \
munin \
nginx \
apache2 \
wget \
libapache2-mod-fcgid \
libcgi-fast-perl \
ssmtp \
perl \
mailutils \
curl tzdata \
munin-node \
autoconf \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*
COPY munin_stats /etc/munin/plugins/munin_stats
COPY munin_update /etc/munin/plugins/munin_update
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) \
rm -rf /etc/munin/plugins \
chmod +x /etc/munin/plugins/munin_stats \
chmod +x /etc/munin/plugins/munin_update
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 launcher
COPY run.sh /usr/local/bin/run
RUN chmod +x /usr/local/bin/run
# persist
VOLUME /var/lib/munin
VOLUME /var/log/munin
VOLUME /var/cache/munin
EXPOSE 80
# health check
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost/munin/ || exit 1
# launcher
CMD ["/usr/local/bin/run"]