Skip to content

Instantly share code, notes, and snippets.

@thomasleveil
Last active February 1, 2020 18:36
Show Gist options
  • Save thomasleveil/7e684c3cb7b25fee68d37afa5fc27a8f to your computer and use it in GitHub Desktop.
Save thomasleveil/7e684c3cb7b25fee68d37afa5fc27a8f to your computer and use it in GitHub Desktop.
docker healthchecks cheatsheet
healthcheck:
test: ["CMD", "wget", "--retry-connrefused", "--tries=10", "--spider", "--server-response", "http://localhost"]
# wget --retry-connrefused --tries=10 --spider --server-response http://localhost:8080/
healthcheck:
test: ["CMD", "curl", "--silent", "--show-error", "--fail", "--retry", "10", "--retry-connrefused", "--retry-delay", "5", "--retry-max-time", "30", "--head", "http://localhost:3000/login"]
# curl --silent --show-error --fail --retry 10 --retry-connrefused --retry-delay 5 --retry-max-time 30 --head http://localhost:3000/login
healthcheck:
test: ["CMD", "nc", "-zv", "localhost", "9091"]
# nc -zv localhost 9091
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment