diff --git a/README.md b/README.md index 711ef3b7..be14d25a 100644 --- a/README.md +++ b/README.md @@ -1076,6 +1076,10 @@ Some older versions (pre-1.14) of Spigot required `--noconsole` to be passed whe Some older servers get confused and think that the GUI interface is enabled. You can explicitly disable that by passing `-e GUI=FALSE`. +### Disable healthcheck via environment variable + +Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of healthchecks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`. + ## Running on RaspberryPi To run this image on a RaspberryPi 3 B+, 4, or newer, use the image tag diff --git a/health.sh b/health.sh index 0ce34be1..e2ad7e72 100644 --- a/health.sh +++ b/health.sh @@ -2,7 +2,10 @@ . ${SCRIPTS:-/}start-utils -if isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then +if isTrue "${DISABLE_HEALTHCHECK}"; then + echo "Healthcheck disabled" + exit 0 +elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then echo "Java process suspended by Autopause function" exit 0 else