summaryrefslogtreecommitdiff
path: root/.docker/app/updater.sh
diff options
context:
space:
mode:
Diffstat (limited to '.docker/app/updater.sh')
-rw-r--r--.docker/app/updater.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/.docker/app/updater.sh b/.docker/app/updater.sh
index c34cf5225..681ef75e1 100644
--- a/.docker/app/updater.sh
+++ b/.docker/app/updater.sh
@@ -10,6 +10,23 @@ unset HTTP_HOST
unset ADMIN_USER_PASS
unset AUTO_CREATE_USER_PASS
+# allow setting environment variables with docker secrets
+# the format is <variable-name>_FILE
+suffix="_FILE"
+
+# Loop through all environment variables
+for var in $(printenv | awk -F= '{print $1}'); do
+ if [[ $var == *"$suffix" ]]; then
+ envFileName=`printenv ${var}`
+ if [[ -f "$envFileName" ]]; then
+ envVar="${var%$suffix}" # generate the original env var without suffix
+ val=`cat $envFileName` # get the value of the secret from file
+ export "${envVar}"="$val" # set the original env var
+ echo "${envVar} environment variable was set by secret ${envFileName}"
+ fi
+ fi
+done
+
# wait for the app container to delete .app_is_ready and perform rsync, etc.
sleep 30