containers-ruby/Dockerfile
2021-03-27 10:47:25 -03:00

41 lines
1.2 KiB
Docker

FROM alpine:3.13.2 AS build
ENV EMAIL monit@sutty.nl
RUN apk add --no-cache tzdata
COPY ./monitrc /etc/monitrc
RUN chmod 600 /etc/monitrc
RUN sed -re "s/@@EMAIL@@/${EMAIL}/" -i /etc/monitrc
FROM alpine:3.13.2
MAINTAINER "f <f@sutty.nl>"
# 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.
ENV EMAIL monit@sutty.nl
# Install monit and remove default config
RUN apk upgrade --no-cache
RUN apk add --no-cache tini monit
COPY --from=build /usr/share/zoneinfo/UTC /etc/localtime
# Create directories
RUN install -dm 2750 -o root -g root /etc/monit.d
RUN install -dm 2750 -o root -g root /var/lib/monit
# Install config. monit.conf~ will be activated after allow_networks
# runs.
COPY --from=build /etc/monitrc /etc/monitrc
# Allow access to the web GUI
EXPOSE 2812
# Sutty's repository
RUN echo 'https://alpine.sutty.nl/alpine/v3.13/sutty' >> /etc/apk/repositories
RUN wget https://alpine.sutty.nl/alpine/sutty.pub -O /etc/apk/keys/alpine@sutty.nl-5ea884cd.rsa.pub
# Use tini as init
ENTRYPOINT ["/sbin/tini", "--"]
# Run monit, it will take care of running services afterwards
CMD ["/usr/bin/monit"]