Simple little framework to simplify health checks in Docker
- Copy healthcheck to your container
- Create a directory (default /etc/healthcheck.d) in your container
- Create simple healthcheck scripts in this directory
- A non-zero exit code will trigger failure of the check
- STDOUT will be discarded
- STDERR can optionally be written to healthcheck output by specifying verbose, but keep it brief.
- Add HEALTHCHECK CMD to your Dockerfile
For a generic TCP port check, use netcat (available by default in Alpine through Busybox) and use the command nc -z localhost in the healthcheck script
- Named parameters instead of positional
- Read options from config file instead of command line parameters
- Long option names