Healthchecks with pgrep
An interesting pattern I noticed while exploring the deployment process at GitLab was the use of pgrep to perform healthchecks in the Dockerfile or even in Kubernetes (technically you could). First define a healthcheck file: #!/bin/bash set -e /usr/bin/pgrep -f <process-to-check> If there is something, the exit code is 0, else it returns exit code 1. That is a pretty nifty trick. Second, add this line into your Dockerfile: HEALTHCHECK --interval=30s --timeout=30s --retries=5 CMD /healthcheck In a kubernetes setting, simply configure your livenessProbe/readinessProbe and you should be good to go....