mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-11-21 03:14:00 +08:00
[Unbound] Added Healthcheck (nslookup)
This commit is contained in:
parent
1fda71e4fa
commit
eb3be80286
@ -18,6 +18,11 @@ EXPOSE 53/udp 53/tcp
|
||||
|
||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
|
||||
# healthcheck (nslookup)
|
||||
COPY healthcheck.sh /healthcheck.sh
|
||||
RUN chmod +x /healthcheck.sh
|
||||
HEALTHCHECK --interval=30s --timeout=10s CMD [ "/healthcheck.sh" ]
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
|
||||
CMD ["/usr/sbin/unbound"]
|
||||
|
12
data/Dockerfiles/unbound/healthcheck.sh
Normal file
12
data/Dockerfiles/unbound/healthcheck.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
nslookup mailcow.email 127.0.0.1 1> /dev/null
|
||||
|
||||
if [ $? == 0 ]; then
|
||||
echo "DNS resolution is working!"
|
||||
exit 0
|
||||
else
|
||||
echo "DNS resolution is not working correctly..."
|
||||
echo "Maybe check your outbound firewall, as it needs to resolve DNS over TCP AND UDP!"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue
Block a user