redis icon indicating copy to clipboard operation
redis copied to clipboard

Add `HEALTHCHECK` instruction to `Dockerfile`

Open fumoboy007 opened this issue 6 months ago • 0 comments

The Dockerfile currently does not have a HEALTHCHECK instruction. Users of the Docker image currently need to add it manually (e.g. via Docker Compose). Instead, the Dockerfile itself should include the instruction.

To determine whether the service is healthy, one can use the PING command via the Redis CLI, which is already part of the image. The command “is useful for […] verifying the server's ability to serve data”.

Most of the default HEALTHCHECK options seem reasonable:

--interval=30s
--timeout=30s
--start-interval=5s
--retries=3

I set --start-period=1s because the default of 0s is too quick for this program.

Users of the image can still override the HEALTHCHECK instruction if they want to customize the command or the options.

fumoboy007 avatar Aug 23 '24 18:08 fumoboy007