fix: availability of env variables
This commit is contained in:
parent
fa45559127
commit
f74c10d4aa
10 changed files with 78 additions and 10 deletions
20
entrypoint.sh
Normal file
20
entrypoint.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
keys="SERVERADDRESS IMPRINTLINK PRIVACYLINK CUSTOMLOGINMESSAGE"
|
||||
|
||||
# Replace env vars in files served by NGINX
|
||||
for file in /usr/share/nginx/html/assets/config-*.js
|
||||
do
|
||||
echo "Processing $file ...";
|
||||
for key in $keys
|
||||
do
|
||||
# Get environment variable
|
||||
value=$(eval echo "\$$key")
|
||||
echo "replace $key by $value"
|
||||
|
||||
# replace __[variable_name]__ value with environment variable
|
||||
sed -i 's|__'"$key"'__|'"$value"'|g' $file
|
||||
done
|
||||
done
|
||||
|
||||
nginx -g 'daemon off;'
|
Loading…
Add table
Add a link
Reference in a new issue