From 4cb12f6cae66340eafd4a7f19f92136f37a77919 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 9 Jul 2020 20:54:34 -0500 Subject: [PATCH] Added DISABLE_HEALTHCHECK --- README.md | 4 ++++ health.sh | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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