Running your multi-container application using Compose
By having our multi-container application up and running on Compose, we can now jump on more specific concepts and identify how to get the most out of our application on local development.
Health check
Our code base has an extra endpoint that we did not mention previously, known as the ping endpoint. As seen on the code base, it’s an endpoint replying with a constant message once invoked:
// Health Check r.GET("/ping", func(c *gin.Context) { c.String(http.StatusOK, "pong") })
This endpoint will be leveraged as a health check. As long as the application is running, it will always give back a response. Should there be something wrong with the application, the endpoint will not reply, and so will be marked unhealthy.
How health check works
By adding a health check using...