From 4991e23f473c81bae46424b043e7f8ab48b63eee Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Tue, 3 Dec 2024 11:46:21 +0100 Subject: [PATCH] add healthcheck for redis Signed-off-by: Simon L. --- Containers/redis/Dockerfile | 4 +++- Containers/redis/healthcheck.sh | 3 +++ php/containers.json | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Containers/redis/healthcheck.sh diff --git a/Containers/redis/Dockerfile b/Containers/redis/Dockerfile index 98fb8529988..64b1c2faafa 100644 --- a/Containers/redis/Dockerfile +++ b/Containers/redis/Dockerfile @@ -14,8 +14,10 @@ RUN set -ex; \ # Get rid of unused binaries rm -f /usr/local/bin/gosu; +COPY --chmod=775 healthcheck.sh /healthcheck.sh + USER 999 ENTRYPOINT ["/start.sh"] -HEALTHCHECK CMD redis-cli -a $REDIS_HOST_PASSWORD PING || exit 1 +HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" diff --git a/Containers/redis/healthcheck.sh b/Containers/redis/healthcheck.sh new file mode 100644 index 00000000000..55f68451b35 --- /dev/null +++ b/Containers/redis/healthcheck.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +redis-cli -a $REDIS_HOST_PASSWORD PING || exit 1 diff --git a/php/containers.json b/php/containers.json index c6ad4b4cbe4..8119dfb38de 100644 --- a/php/containers.json +++ b/php/containers.json @@ -313,6 +313,14 @@ "image": "nextcloud/aio-redis", "user": "999", "init": true, + "healthcheck": { + "start_period": "0s", + "test": "/healthcheck.sh", + "interval": "30s", + "timeout": "30s", + "start_interval": "5s", + "retries": 3 + }, "expose": [ "6379" ],