From fc666fae640605bcad68227701f807b029b3c737 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 19 Jul 2022 14:39:52 +0100 Subject: [PATCH] Moving the single image healthcheck script to be within the single image directory and updating it to look for the environment variable file. --- hosting/single/Dockerfile | 2 +- hosting/{scripts => single}/healthcheck.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) rename hosting/{scripts => single}/healthcheck.sh (93%) diff --git a/hosting/single/Dockerfile b/hosting/single/Dockerfile index 4e3239d960..b5bf17adde 100644 --- a/hosting/single/Dockerfile +++ b/hosting/single/Dockerfile @@ -108,7 +108,7 @@ RUN chmod +x install.sh && ./install.sh WORKDIR / ADD hosting/single/runner.sh . RUN chmod +x ./runner.sh -ADD hosting/scripts/healthcheck.sh . +ADD hosting/single/healthcheck.sh . RUN chmod +x ./healthcheck.sh ADD hosting/scripts/build-target-paths.sh . diff --git a/hosting/scripts/healthcheck.sh b/hosting/single/healthcheck.sh similarity index 93% rename from hosting/scripts/healthcheck.sh rename to hosting/single/healthcheck.sh index 80f2ece0b6..b92cd153a3 100644 --- a/hosting/scripts/healthcheck.sh +++ b/hosting/single/healthcheck.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash healthy=true +if [ -f "/data/.env" ]; then + export $(cat /data/.env | xargs) +fi + if [[ $(curl -Lfk -s -w "%{http_code}\n" http://localhost/ -o /dev/null) -ne 200 ]]; then echo 'ERROR: Budibase is not running'; healthy=false