A generic Docker compose health check for HTTP services with wget
Published on 2022-12-26 • Modified on 2022-12-26
This snippet shows how to create a Docker compose health check for HTTP services with wget. Usually, we can use CURL for these kinds of checks, eg:
curl --silent --fail localhost:9200/_cluster/health?wait_for_status=yellow&timeout=30s
But if CURL is not available, we can also use wget
.
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:1080"]
interval: 10s
timeout: 5s
retries: 5
More on Stackoverflow Read the doc Random snippet
Call to action
Did you like this post? You can help me back in several ways: (use the "reply" link on the right to comment or to contact me )
- Report any error/typo.
- Report something that could be improved.
- Like and repost!
- Follow me on Bluesky 🦋
- Subscribe to the RSS feed.
- Click on the More on Stackoverflow buttons to make me win "Announcer" badges 🏅.
Thank you for reading! And see you soon on Strangebuzz! 😉
