I have a Kafka Streams application set-up as a service in Docker Compose file where the test
command in healthcheck
is set-up as curl http://localhost:8080/q/health/ready || exit 1
. A few questions on this set-up.
- Who executes the
wget
command -docker
on host? If yes, then8080
in the container must be exposed. Further,wget
should be available in the host and not in the container image. Correct? - The
test
command above means thatexit 1
will be run ifcurl
returns non-zero exit code. Whereas, the health-check end-point will respond with a HTTP status code. Where does the translation of HTTP status code or semantics ofUP
orDOWN
into shell exit codes happen? - This link has various return codes from
curl
. Exit status - Everything curl. I don’t follow why aGET
fromcurl
to a simple REST end-point may return any of the non-zero return code and therefore, triggerexit 1
. - Conversely, I don’t follow how a
GET
returning a HTTP status code is translated into a non-zero return code triggeringexit 1
.
Can you please explain?