From 74a6d9154ea78155650260757748972be7f707ff Mon Sep 17 00:00:00 2001 From: Peter Havekes Date: Wed, 2 Sep 2026 10:06:50 +0200 Subject: [PATCH 1/2] Add health check to java base image --- java21/Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java21/Dockerfile b/java21/Dockerfile index 3a53cb5..a1bdd46 100644 --- a/java21/Dockerfile +++ b/java21/Dockerfile @@ -1 +1,9 @@ FROM eclipse-temurin:21-jre-alpine +RUN apk add --no-cache curl +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health From d42b1faead712224d60f77ff43135b82ea5bb19e Mon Sep 17 00:00:00 2001 From: Peter Havekes Date: Thu, 3 Sep 2026 08:23:43 +0200 Subject: [PATCH 2/2] Add healthcheck to base images --- apache2-shibboleth/Dockerfile | 8 ++++++++ apache2/Dockerfile | 8 ++++++++ haproxy28/Dockerfile | 15 +++++++++++++++ php72-apache2-node14-composer2/Dockerfile | 8 ++++++++ php72-apache2-node16-composer2/Dockerfile | 8 ++++++++ php72-apache2/Dockerfile | 8 ++++++++ php82-apache2-node20-composer2/Dockerfile | 8 ++++++++ php82-apache2/Dockerfile | 8 ++++++++ php85-apache2-node24/Dockerfile | 8 ++++++++ php85-apache2/Dockerfile | 8 ++++++++ satosa/Dockerfile | 12 ++++++++++++ 11 files changed, 99 insertions(+) diff --git a/apache2-shibboleth/Dockerfile b/apache2-shibboleth/Dockerfile index 5f3f133..3a8a058 100644 --- a/apache2-shibboleth/Dockerfile +++ b/apache2-shibboleth/Dockerfile @@ -33,3 +33,11 @@ EXPOSE 80 # Start Shibboleth and Apache ENTRYPOINT ["/entrypoint.sh"] CMD ["/usr/local/bin/shib.sh"] + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health diff --git a/apache2/Dockerfile b/apache2/Dockerfile index 6d6fbad..92fdfa5 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -45,3 +45,11 @@ EXPOSE 80 # Start Apache ENTRYPOINT ["/entrypoint.sh"] CMD ["apachectl", "-D", "FOREGROUND"] + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health diff --git a/haproxy28/Dockerfile b/haproxy28/Dockerfile index 3de9354..3c61c2e 100644 --- a/haproxy28/Dockerfile +++ b/haproxy28/Dockerfile @@ -1,3 +1,18 @@ FROM haproxy:2.8 + +USER root +RUN apt-get update && \ + apt-get install -y curl && \ + rm -rf /var/lib/apt/lists/* \ +USER haproxy + COPY conf/haproxy.pem /usr/local/etc/haproxy +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health + diff --git a/php72-apache2-node14-composer2/Dockerfile b/php72-apache2-node14-composer2/Dockerfile index 95695b1..34cefa1 100644 --- a/php72-apache2-node14-composer2/Dockerfile +++ b/php72-apache2-node14-composer2/Dockerfile @@ -25,3 +25,11 @@ RUN mkdir /var/www/html/public RUN rm -rf /etc/apache2/sites-enabled/* COPY ./conf/appconf.conf /etc/apache2/sites-enabled/ + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health diff --git a/php72-apache2-node16-composer2/Dockerfile b/php72-apache2-node16-composer2/Dockerfile index 86df96f..86ca02d 100644 --- a/php72-apache2-node16-composer2/Dockerfile +++ b/php72-apache2-node16-composer2/Dockerfile @@ -25,3 +25,11 @@ RUN mkdir /var/www/html/public RUN rm -rf /etc/apache2/sites-enabled/* COPY ./conf/appconf.conf /etc/apache2/sites-enabled/ + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health diff --git a/php72-apache2/Dockerfile b/php72-apache2/Dockerfile index 7fcec3b..7042558 100644 --- a/php72-apache2/Dockerfile +++ b/php72-apache2/Dockerfile @@ -86,3 +86,11 @@ EXPOSE 80 # Start Apache ENTRYPOINT ["/entrypoint.sh"] CMD ["apache2-foreground"] + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health diff --git a/php82-apache2-node20-composer2/Dockerfile b/php82-apache2-node20-composer2/Dockerfile index 2258a7e..249e93e 100644 --- a/php82-apache2-node20-composer2/Dockerfile +++ b/php82-apache2-node20-composer2/Dockerfile @@ -25,3 +25,11 @@ RUN mkdir -p /var/www/html/public RUN rm -rf /etc/apache2/sites-enabled/* COPY ./conf/appconf.conf /etc/apache2/sites-enabled/ + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health diff --git a/php82-apache2/Dockerfile b/php82-apache2/Dockerfile index 43c52f1..17f5736 100644 --- a/php82-apache2/Dockerfile +++ b/php82-apache2/Dockerfile @@ -72,3 +72,11 @@ EXPOSE 80 # Start Apache ENTRYPOINT ["/entrypoint.sh"] CMD ["apache2-foreground"] + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health diff --git a/php85-apache2-node24/Dockerfile b/php85-apache2-node24/Dockerfile index 19a216e..24394ba 100644 --- a/php85-apache2-node24/Dockerfile +++ b/php85-apache2-node24/Dockerfile @@ -24,3 +24,11 @@ RUN mkdir -p /var/www/html/public RUN rm -rf /etc/apache2/sites-enabled/* COPY ./conf/appconf.conf /etc/apache2/sites-enabled/ + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health diff --git a/php85-apache2/Dockerfile b/php85-apache2/Dockerfile index 1f44bd8..1e079ff 100644 --- a/php85-apache2/Dockerfile +++ b/php85-apache2/Dockerfile @@ -76,3 +76,11 @@ EXPOSE 80 # Start Apache ENTRYPOINT ["/entrypoint.sh"] CMD ["apache2-foreground"] + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health diff --git a/satosa/Dockerfile b/satosa/Dockerfile index a795757..1eb66d7 100644 --- a/satosa/Dockerfile +++ b/satosa/Dockerfile @@ -1,4 +1,8 @@ FROM docker.io/satosa:8 +USER root:root +RUN apt-get update && \ + apt-get install -y curl && \ + rm -rf /var/lib/apt/lists/* COPY ./conf/openconext-entrypoint.sh /usr/local/bin/ @@ -8,3 +12,11 @@ USER root:root # https://stackoverflow.com/questions/47062854/custom-docker-image-doesnt-inherit-cmd/47063296#47063296 CMD ["gunicorn","-b0.0.0.0:8080","satosa.wsgi:app"] + +HEALTHCHECK \ + --start-period=30s \ + --start-interval=1s \ + --interval=10s \ + --timeout=1s \ + --retries=20 \ + CMD curl --fail -s -o /dev/null -w "%{http_code}" http://localhost/internal/health