A Docker healthcheck reports whether its command succeeds. It does not stop the container, replace it, or activate a restart policy by itself. Restart policies wait for the container's main process to terminate—or for Docker's own lifecycle to change—so an unhealthy container can remain Up indefinitely.
That separation ...