Dockerfiles support as of Docker 1.12 support a HEALTHCHECK
instruction that provides the Docker host the ability to determine if a container is not healthy even if the main container process is still running.
https://docs.docker.com/engine/reference/builder/#healthcheck