Specify the HEALTHCHECK of the Docker image.
HEALTHCHECK --timeout=3s CMD curl -f http://localhost/ || exit 1