title: Docker container not restarting on health check failures
body: <p>I have the following <code>docker-compose</code> file</p>
  
  <pre><code>version: "3.7"
  services:
    myservice:
      restart: always
      image: myimage
      hostname: myhost
      env_file:
        - ./env/common.env
      healthcheck:
        test: ["CMD-SHELL", "curl --silent --fail localhost:9091/status || exit 1"]
        interval: 5s
        timeout: 1s
        retries: 1
        start_period: 5s   
      ports:
        - 27018:27018
      volumes: 
        - type: bind
          source: ./scripts/myservice
          target: /scripts  
      entrypoint: ["/bin/sh", "-c", "apk add bash &amp;&amp; chmod a+x /scripts/init.sh &amp;&amp; /scripts/init.sh"]
  </code></pre>
  
  <p>On running <code>docker-compose run myservice</code>, my container starts correctly (it doesn't crash).
  However, the health check is failing and when I do a <code>docker ps</code>, I can see that the container is unhealthy.</p>
  
  <p>I want the container to restart automatically on when the container is unhealthy, however the container throws an error in the logs and continues to run when the <code>curl</code> call is made.</p>
  
  <p>How can I make sure that my container is restarted when the health check fails?</p>