Skip to content

Some deployments do not have health checks

Created by: ggilmore

Docker has native support for healthchecks, which allow you to see (through docker ps or docker inspect) whether or not a container is healthy. This is useful for debugging and can allow external systems to consume this information for automatic healing, etc.

These checks can be baked into each of our dockerfiles with the HEALTHCHECK directive: https://docs.docker.com/engine/reference/builder/#healthcheck

I've added external support for this via our docker-compose deployment, but adding these to the images themselves will remove a lot of boilerplate.

Example:

https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/2d7870b10da49b9e6b6a223d4e559750bd719624/docker-compose/docker-compose.yaml#L229-L234