1
0
Fork 0
mirror of https://github.com/Luzifer/dns.git synced 2024-12-23 03:11:20 +00:00
dns/Dockerfile
Knut Ahlers a0806bee08
Add health check to docker container
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-02-06 20:20:13 +01:00

33 lines
686 B
Docker

FROM golang:alpine
ARG COREDNS_VERSION=v1.0.5
ADD ./build.sh /usr/local/bin/build.sh
ADD ./cron_generate.go /src/cron_generate.go
RUN set -ex \
&& apk --no-cache add git bash \
&& bash /usr/local/bin/build.sh
FROM alpine
LABEL maintainer Knut Ahlers <knut@ahlers.me>
COPY --from=0 /go/bin/coredns /usr/local/bin/
ADD ./requirements.txt /src/requirements.txt
RUN set -ex \
&& apk --no-cache add python3 bind-tools \
&& pip3 install -r /src/requirements.txt
ADD . /src
WORKDIR /src
EXPOSE 53/udp 53
VOLUME ["/src/zones"]
HEALTHCHECK --interval=30s --timeout=5s \
CMD dig +short @localhost health.server.test TXT || exit 1
ENTRYPOINT ["/usr/local/bin/coredns"]
CMD ["--"]