diff --git a/Dockerfile b/Dockerfile index 59c5898..b8aef6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,10 @@ FROM sutty/monit:latest MAINTAINER "f " + +RUN apk add --no-cache knot +COPY ./monit.conf /etc/monit.d/knot.conf + +EXPOSE 53 +EXPOSE 53/udp + +VOLUME /var/lib/knot diff --git a/monit.conf b/monit.conf new file mode 100644 index 0000000..c92e900 --- /dev/null +++ b/monit.conf @@ -0,0 +1,6 @@ +check process knot with pidfile /tmp/knot.pid + start program = "/usr/sbin/knotd -d" + stop program = "/usr/sbin/knotc stop" + if 5 restarts within 8 cycles then alert + if failed port 53 type udp protocol dns for 3 times within 5 cycles then restart + if failed port 53 type tcp protocol dns for 3 times within 5 cycles then restart