diff --git a/Dockerfile b/Dockerfile index db79b6a..2d1947b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,13 @@ FROM alpine:3.13.1 AS build +ENV EMAIL monit@sutty.nl + RUN apk add --no-cache tzdata FROM alpine:3.13.1 MAINTAINER "f " +COPY ./monitrc /etc/monitrc +RUN chmod 600 /etc/monitrc +RUN sed -re "s/@@EMAIL@@/${EMAIL}/" -i /etc/monitrc # TODO: We don't want to receive lots of email, so we'll change this to # a pingy instance that will also work as a status site. @@ -18,8 +23,7 @@ RUN install -dm 2750 -o root -g root /var/lib/monit # Install config. monit.conf~ will be activated after allow_networks # runs. -COPY ./monitrc /etc/monitrc -RUN chmod 600 /etc/monitrc +COPY --from=build /etc/monitrc /etc/monitrc # Allow access to the web GUI EXPOSE 2812 diff --git a/monitrc b/monitrc index 60f0940..9ec502d 100644 --- a/monitrc +++ b/monitrc @@ -7,6 +7,7 @@ set statefile /var/lib/monit/state set eventqueue basedir /var/lib/monit/events slots 100 set mailserver postfix set limits { programoutput: 1 MB } +set alert @@EMAIL@@ set httpd port 2812 allow localhost