add healthcheck for redis

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2024-12-03 11:46:21 +01:00
parent b36cc2e2b0
commit aa0620f2ea
3 changed files with 14 additions and 1 deletions

View file

@ -14,8 +14,10 @@ RUN set -ex; \
# Get rid of unused binaries # Get rid of unused binaries
rm -f /usr/local/bin/gosu; rm -f /usr/local/bin/gosu;
COPY --chmod=775 healthcheck.sh /healthcheck.sh
USER 999 USER 999
ENTRYPOINT ["/start.sh"] ENTRYPOINT ["/start.sh"]
HEALTHCHECK CMD redis-cli -a $REDIS_HOST_PASSWORD PING || exit 1 HEALTHCHECK CMD /healthcheck.sh
LABEL com.centurylinklabs.watchtower.enable="false" LABEL com.centurylinklabs.watchtower.enable="false"

View file

@ -0,0 +1,3 @@
#!/bin/bash
redis-cli -a "$REDIS_HOST_PASSWORD" PING || exit 1

View file

@ -329,6 +329,14 @@
"image": "nextcloud/aio-redis", "image": "nextcloud/aio-redis",
"user": "999", "user": "999",
"init": true, "init": true,
"healthcheck": {
"start_period": "0s",
"test": "/healthcheck.sh",
"interval": "30s",
"timeout": "30s",
"start_interval": "5s",
"retries": 3
},
"expose": [ "expose": [
"6379" "6379"
], ],