How to Docker healthcheck a Go HTTP server

Written by
Link to Post by 

Hi all,

I am currently searching for the way to serve a healthcheck on a Go HTTP server, without exposing it to outside users. I want this to hide implementation details from the user and, in case the healthcheck consumes some resources, keep it internal for Docker to use it.

I initially had a route /healthcheck on my server that would be exposed to all interfaces ( I then decided to have a healthcheck server in its goroutine listening on localhost only ( However this approach has the problem that if the main public server fails, the healthcheck might still succeed.

How would you solve the problem of having a healthcheck server without exposing it to the outside world?


submitted by /u/dowitex
[link] [comments]

Article Tags:
· ·
Article Categories:

Comments are closed.