diff --git a/Dockerfile b/Dockerfile index 59c5898..2c0ecf8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,11 @@ FROM sutty/monit:latest MAINTAINER "f " + +RUN apk add --no-cache opendkim +COPY ./monit.conf /etc/monit.d/opendkim.conf +COPY ./opendkim.sh /usr/local/bin/opendkim +RUN chmod 755 /usr/local/bin/opendkim +RUN install -dm 2750 -o opendkim -g opendkim /run/opendkim + +EXPOSE 8891 +VOLUME /etc/opendkim diff --git a/monit.conf b/monit.conf new file mode 100644 index 0000000..755b944 --- /dev/null +++ b/monit.conf @@ -0,0 +1,3 @@ +check process opendkim with pidfile /tmp/opendkim.pid + start program = "/usr/local/bin/opendkim start" + stop program = "/usr/local/bin/opendkim stop" diff --git a/opendkim.sh b/opendkim.sh new file mode 100644 index 0000000..2c0deb4 --- /dev/null +++ b/opendkim.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +pid=/tmp/opendkim.pid + +case $1 in + stop) cat ${pid} | xargs kill ;; + *) /usr/sbin/opendkim ;; +esac