From 0fc2298106fda89223c8fe770114cb31a4ca0ee7 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Fri, 13 Dec 2024 11:35:58 +0100 Subject: [PATCH] Added health checks to Dockerfiles Health check commands have been added to the Dockerfiles. These checks will run at an interval of 30 seconds, with a timeout of 10 seconds and a start period of 5 seconds. The system will retry these checks up to three times before marking the service as unhealthy. Different health check commands are used depending on the specific Dockerfile. --- Dockerfile | 2 ++ Dockerfile.daemon | 2 ++ Dockerfile.webui | 1 + 3 files changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6b03111..50489b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,3 +55,5 @@ RUN bash -c "if [ -n \"${VERSION}\" ] ; then echo ${VERSION} > ${WEBCRON_ROOT}/ USER root ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] + +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD curl -f http://localhost:80/health || exit 1 diff --git a/Dockerfile.daemon b/Dockerfile.daemon index cdb477b..f6dc8e4 100644 --- a/Dockerfile.daemon +++ b/Dockerfile.daemon @@ -41,3 +41,5 @@ RUN bash -c "if [ -n \"${VERSION}\" ] ; then echo ${VERSION} > ${WEBCRON_ROOT}/ USER root ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] + +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD bin/console webcron:health diff --git a/Dockerfile.webui b/Dockerfile.webui index a544813..64c58ea 100644 --- a/Dockerfile.webui +++ b/Dockerfile.webui @@ -55,3 +55,4 @@ RUN bash -c "if [ -n \"${VERSION}\" ] ; then echo ${VERSION} > ${WEBCRON_ROOT}/ USER root ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD curl -f http://localhost:80 || exit 1