Skip to content

Commit

Permalink
add healthcheck for redis
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L. <[email protected]>
  • Loading branch information
szaimen committed Dec 3, 2024
1 parent f6b4df2 commit 4991e23
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Containers/redis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions Containers/redis/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

redis-cli -a $REDIS_HOST_PASSWORD PING || exit 1
8 changes: 8 additions & 0 deletions php/containers.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand Down

0 comments on commit 4991e23

Please sign in to comment.