You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docker health check is not working when using a proxy #7529
This problem exists when using a docker image in a corporate environment. Running docker psyields: gogs/gogs "/app/gogs/docker/st..." 5 days ago Up 8 minutes (unhealthy)
The reason is that in the health check curl is looking for localhost with a specific port. I assume that the proxy is called to resolve localhost:3000. This is correctly resolved, but by changing the port to 10880 -p 10880:3000 when connecting externally, the curl will not be fulfilled. The health check reports unhealthy.
To reproduce
The problem occurs when using a proxy to connect to the internet. This can be achieved with running the docker image using the parameter: -e HTTP_PROXY="host.docker.internal" -e HTTPS_PROXY="host.docker.internal"
Expected behavior
It is expected that docker ps shows the container as healthy.
Additional context
In the Dockerfile the health check should be written as: HEALTHCHECK CMD (curl --noproxy localhost -o /dev/null -sS http://localhost:3000/healthcheck) || exit 1
Activity
Update Dockerfile to fix gogs#7529
Merge pull request #1 from MatthiasJobst/proxy
Update Dockerfile to fix gogs#7529