Perform Health Checks in Docker

You can customize Gateway's default health check behavior. For example, you want to publish a service on the Gateway that is important to your business. To ensure that the service is ready to accept traffic after Gateway start up, you want to create a bootstrap service that checks the status of the Gateway service. For more information on how to create your own health check, see Customize Default Health Check Behavior.
gateway93
Use the Docker HEALTHCHECK instruction to test that the container for the Container Gateway it is working. The HEALTHCHECK instruction can detect issues such as a web server stuck in an infinite loop and unable to handle new connections, even though the server process is still running.
When the Container Gateway is starting up, the status shows "starting". Whenever a health check passes, the status displays "healthy". After consecutive failures in retries or if the Gateway server process cannot start, the health check status becomes "unhealthy".
Contents:
View the Health Check Status
Use the
docker ps
command to see a list of the currently available running containers and their associated health check statuses. The following is an example command:
 
$ docker ps --format "table {{.Names}}\t{{.Status}}"
The output displays the container names in the "Names" column and each container's health check status in the "Status" column. This example shows a healthy Gateway server process.
NAMES STATUS docker_api-gateway_1 Up 29 minutes (healthy)
 
Customize Default Health Check Behavior
You can customize Gateway's default health check behavior. For example, you want to publish a service on the Gateway that is important to your business. To ensure that the service is ready to accept traffic after Gateway start up, you want to create a bootstrap service that checks the status of the Gateway service. For more information on how to create your own health check, see Customize Default Health Check Behavior.
To extract more information about the health and status of containers, use the
docker inspect
command.