distribution-library-image
distribution-library-image copied to clipboard
Healthcheck
Hi. Maybe it would be good idea to add healthcheck (https://docs.docker.com/engine/reference/builder/#healthcheck)? So that if something happens, container can be automatically restarted?
Maybe something like:
[[ "$(curl -o /dev/null -w '%{http_code}' https://127.0.0.1:5000/v2/)" == 401 ]] && exit 0 || exit 1
(curl would have to be installed in the image) ?
I am using wget, curl doesn't seem required to fulfill the purpose:
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:5000/v2"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 10