The current HEALTHCHECK is trying to use Curl.
HEALTHCHECK --interval=60s --start-interval=20s --timeout=3s \
CMD curl -f http://localhost/ || exit 1
However Curl isn't available within the production layer, it's only installed into the build layer so containers always show can unhealthy.
I've worked around this by launching with a custom healthcheck command using Wget that is available in the production layer.
--health-cmd="wget --quiet --spider http://127.0.0.1:80 || exit 1"
The current
HEALTHCHECKis trying to use Curl.However Curl isn't available within the
productionlayer, it's only installed into thebuildlayer so containers always show can unhealthy.I've worked around this by launching with a custom healthcheck command using Wget that is available in the production layer.