From 461a0eeea3a8a6b3783ef17c50286e44f9dc4f3e Mon Sep 17 00:00:00 2001 From: Michael Krieger Date: Thu, 16 Dec 2021 15:52:30 -0500 Subject: [PATCH] Permit the healthcheck to work if a BASE_PATH is set You can set the environment variable BASE_PATH=statping so that https://yoursite.domain:1234/statping/ is how the app is accessed. Note that a forward-slash is not used (which would otherwise allow just the variable to be dropped in). In order to do that, the healthcheck, which does not obey BASE_PATH, must be disabled. This should make it continue to work. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ca503f78..18aac4fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,9 +60,10 @@ ENV IS_DOCKER=true ENV SASS=/usr/local/bin/sassc ENV STATPING_DIR=/app ENV PORT=8080 +ENV BASE_PATH="" EXPOSE $PORT -HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true" +HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD if [ -z "$BASE_PATH" ]; then HEALTHPATH="/health"; else HEALTHPATH="/$BASE_PATH/health" ; fi && curl -s "http://localhost:80$HEALTHPATH" | jq -r -e ".online==true" CMD statping --port $PORT