From f9da1c64b170e5f8f4a4ea8e188ded32f793e6ab Mon Sep 17 00:00:00 2001 From: Peter Schiffer <3899107+pschiffe@users.noreply.github.com> Date: Wed, 3 Jan 2024 22:28:50 +0100 Subject: [PATCH] Add healthchecks --- ansible-playbook-mysql.yml | 4 ++++ docker-compose-mysql.yml | 4 ++++ pdns-admin/Dockerfile | 3 +++ pdns-mysql/Dockerfile | 2 ++ pdns-mysql/Dockerfile.alpine | 2 ++ pdns-pgsql/Dockerfile | 2 ++ pdns-pgsql/Dockerfile.alpine | 2 ++ pdns-recursor/Dockerfile | 2 ++ pdns-recursor/Dockerfile.alpine | 2 ++ 9 files changed, 23 insertions(+) diff --git a/ansible-playbook-mysql.yml b/ansible-playbook-mysql.yml index 0ad3dba..f1e5e32 100644 --- a/ansible-playbook-mysql.yml +++ b/ansible-playbook-mysql.yml @@ -96,6 +96,10 @@ - '8888:80' volumes: - /etc/localtime:/etc/localtime:ro + healthcheck: + test: ['CMD', 'curl', '-fsSL', 'http://127.0.0.1:80'] + timeout: 10s + retries: 5 tags: - db diff --git a/docker-compose-mysql.yml b/docker-compose-mysql.yml index b27280b..bb90cfb 100644 --- a/docker-compose-mysql.yml +++ b/docker-compose-mysql.yml @@ -38,6 +38,10 @@ services: - '8988:80' volumes: - /etc/localtime:/etc/localtime:ro + healthcheck: + test: ['CMD', 'curl', '-fsSL', 'http://127.0.0.1:80'] + timeout: 10s + retries: 5 pdns-mysql-master: image: pschiffe/pdns-mysql:${PDNS_MYSQL_TAG:-latest} diff --git a/pdns-admin/Dockerfile b/pdns-admin/Dockerfile index 1037bb0..9b629b7 100644 --- a/pdns-admin/Dockerfile +++ b/pdns-admin/Dockerfile @@ -68,6 +68,9 @@ RUN yarn install --pure-lockfile --production \ EXPOSE 8080 +HEALTHCHECK --interval=10s --timeout=10s --retries=3 --start-period=6s \ + CMD ["curl", "-fsSL", "http://127.0.0.1:8080"] + ENTRYPOINT [ "/docker-entrypoint.sh" ] CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ] diff --git a/pdns-mysql/Dockerfile b/pdns-mysql/Dockerfile index 045bf0a..c65817d 100644 --- a/pdns-mysql/Dockerfile +++ b/pdns-mysql/Dockerfile @@ -23,6 +23,8 @@ ENV VERSION=4.8 \ EXPOSE 53 53/udp +HEALTHCHECK --interval=10s --timeout=10s --retries=3 --start-period=2s CMD ["pdns_control", "ping"] + ENTRYPOINT [ "/docker-entrypoint.sh" ] CMD [ "/usr/sbin/pdns_server" ] diff --git a/pdns-mysql/Dockerfile.alpine b/pdns-mysql/Dockerfile.alpine index cce7aeb..f3f7347 100644 --- a/pdns-mysql/Dockerfile.alpine +++ b/pdns-mysql/Dockerfile.alpine @@ -22,6 +22,8 @@ ENV VERSION=4.8 \ EXPOSE 53 53/udp +HEALTHCHECK --interval=10s --timeout=10s --retries=3 --start-period=2s CMD ["pdns_control", "ping"] + ENTRYPOINT [ "/docker-entrypoint.sh" ] CMD [ "/usr/sbin/pdns_server" ] diff --git a/pdns-pgsql/Dockerfile b/pdns-pgsql/Dockerfile index b49e244..eb8baa8 100644 --- a/pdns-pgsql/Dockerfile +++ b/pdns-pgsql/Dockerfile @@ -23,6 +23,8 @@ ENV VERSION=4.8 \ EXPOSE 53 53/udp +HEALTHCHECK --interval=10s --timeout=10s --retries=3 --start-period=2s CMD ["pdns_control", "ping"] + ENTRYPOINT [ "/docker-entrypoint.sh" ] CMD [ "/usr/sbin/pdns_server" ] diff --git a/pdns-pgsql/Dockerfile.alpine b/pdns-pgsql/Dockerfile.alpine index 72f5dea..bb9c97c 100644 --- a/pdns-pgsql/Dockerfile.alpine +++ b/pdns-pgsql/Dockerfile.alpine @@ -22,6 +22,8 @@ ENV VERSION=4.8 \ EXPOSE 53 53/udp +HEALTHCHECK --interval=10s --timeout=10s --retries=3 --start-period=2s CMD ["pdns_control", "ping"] + ENTRYPOINT [ "/docker-entrypoint.sh" ] CMD [ "/usr/sbin/pdns_server" ] diff --git a/pdns-recursor/Dockerfile b/pdns-recursor/Dockerfile index 1ec9ba8..f6b1221 100644 --- a/pdns-recursor/Dockerfile +++ b/pdns-recursor/Dockerfile @@ -22,6 +22,8 @@ ENV VERSION=4.9 \ EXPOSE 53 53/udp +HEALTHCHECK --interval=10s --timeout=10s --retries=3 --start-period=2s CMD ["rec_control", "ping"] + ENTRYPOINT [ "/docker-entrypoint.sh" ] CMD [ "/usr/sbin/pdns_recursor" ] diff --git a/pdns-recursor/Dockerfile.alpine b/pdns-recursor/Dockerfile.alpine index 2c437f5..3e46946 100644 --- a/pdns-recursor/Dockerfile.alpine +++ b/pdns-recursor/Dockerfile.alpine @@ -20,6 +20,8 @@ ENV VERSION=4.9 \ EXPOSE 53 53/udp +HEALTHCHECK --interval=10s --timeout=10s --retries=3 --start-period=2s CMD ["rec_control", "ping"] + ENTRYPOINT [ "/docker-entrypoint.sh" ] CMD [ "/usr/sbin/pdns_recursor" ]