mirror of
https://github.com/Luzifer/dns.git
synced 2024-11-09 22:50:06 +00:00
Add health check to docker container
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
bbae3c1e22
commit
a0806bee08
2 changed files with 10 additions and 1 deletions
|
@ -16,7 +16,7 @@ COPY --from=0 /go/bin/coredns /usr/local/bin/
|
|||
|
||||
ADD ./requirements.txt /src/requirements.txt
|
||||
RUN set -ex \
|
||||
&& apk --no-cache add python3 \
|
||||
&& apk --no-cache add python3 bind-tools \
|
||||
&& pip3 install -r /src/requirements.txt
|
||||
|
||||
ADD . /src
|
||||
|
@ -26,5 +26,8 @@ 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 ["--"]
|
||||
|
|
|
@ -354,4 +354,10 @@ zones:
|
|||
- name: ""
|
||||
alias: docker01.cloud.kserver.biz.
|
||||
|
||||
server.test:
|
||||
entries:
|
||||
- name: health
|
||||
type: TXT
|
||||
records:
|
||||
- "OK"
|
||||
...
|
||||
|
|
Loading…
Reference in a new issue