Hacker News new | ask | show | jobs
by nickjj 1622 days ago
It's also useful for alternative health check commands depending on which environment you're in.

For example you could configure a Docker Compose health check to curl an endpoint for a 200 in production but in development override the health check command to call /bin/true so you don't get log spam in development from your health check while ensuring the health check still passes since /bin/true is an extremely minimal command that returns an exit code of 0. This can be controlled by a single environment variable too, no changes needed to your docker-compose.yml file.

I covered this pattern in a recent DockerCon talk at https://nickjanetakis.com/blog/best-practices-around-product....