send emails

This commit is contained in:
f 2021-03-27 10:47:17 -03:00
parent 99ea5a001f
commit 8809e18b77
2 changed files with 7 additions and 2 deletions

View file

@ -1,8 +1,13 @@
FROM alpine:3.13.1 AS build FROM alpine:3.13.1 AS build
ENV EMAIL monit@sutty.nl
RUN apk add --no-cache tzdata RUN apk add --no-cache tzdata
FROM alpine:3.13.1 FROM alpine:3.13.1
MAINTAINER "f <f@sutty.nl>" MAINTAINER "f <f@sutty.nl>"
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 # 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. # 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 # Install config. monit.conf~ will be activated after allow_networks
# runs. # runs.
COPY ./monitrc /etc/monitrc COPY --from=build /etc/monitrc /etc/monitrc
RUN chmod 600 /etc/monitrc
# Allow access to the web GUI # Allow access to the web GUI
EXPOSE 2812 EXPOSE 2812

View file

@ -7,6 +7,7 @@ set statefile /var/lib/monit/state
set eventqueue basedir /var/lib/monit/events slots 100 set eventqueue basedir /var/lib/monit/events slots 100
set mailserver postfix set mailserver postfix
set limits { programoutput: 1 MB } set limits { programoutput: 1 MB }
set alert @@EMAIL@@
set httpd port 2812 set httpd port 2812
allow localhost allow localhost