I have a container image that has two binaries -
application exposes two endpoints - one for application at
0.0.0.0:8080/app and a health check endpoint at
localhost:9000/health. These endpoints are created using Fastify. The
health binary does a HTTP
GET on the health check endpoint and the binary is invoked by the
healthcheck.test in the Docker Compose file. The
host because the application must connect to Kafka on a different host.
The health check never goes through because the
health binary hangs. I ran a
docker exec -it for the container and ran the
health binary in container shell. The command never finishes - it won’t even terminate with a timed out message - just keeps on running. However, on the host where the Docker Compose project is running, if I do a
curl http://localhost:9000/health I get a health output correctly.
So, why does the
health binary hang?
This is the Compose YAML.