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
wgetcommand -dockeron host? If yes, then8080in the container must be exposed. Further,wgetshould be available in the host and not in the container image. Correct? - The
testcommand above means thatexit 1will be run ifcurlreturns 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 ofUPorDOWNinto shell exit codes happen? - This link has various return codes from
curl. Exit status - Everything curl. I don’t follow why aGETfromcurlto 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
GETreturning a HTTP status code is translated into a non-zero return code triggeringexit 1.
Can you please explain?