distribution-library-image icon indicating copy to clipboard operation
distribution-library-image copied to clipboard

Healthcheck

Open nenadalm opened this issue 8 years ago • 2 comments

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) ?

nenadalm avatar Oct 09 '17 08:10 nenadalm

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

cf-sewe avatar May 13 '23 10:05 cf-sewe