mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-02-27 15:40:34 +00:00
commit
70ae185fb3
@ -23,7 +23,7 @@ COPY ./docker/substitute-env-variables.sh ./entrypoint.sh
|
|||||||
RUN chmod +x ./entrypoint.sh
|
RUN chmod +x ./entrypoint.sh
|
||||||
|
|
||||||
# Substitute environment variables in nginx configuration and index.html
|
# Substitute environment variables in nginx configuration and index.html
|
||||||
ENTRYPOINT ["./entrypoint.sh", "/usr/share/nginx/html/index.html,/etc/nginx/conf.d/default.conf"]
|
ENTRYPOINT ["./entrypoint.sh", "/usr/share/nginx/html/index.html,/etc/nginx/conf.d/default.conf", "PRODUCTION,API_URL,IRB_URL,HOME_ROUTE,PORT0"]
|
||||||
|
|
||||||
### STAGE 3: Profit! ###
|
### STAGE 3: Profit! ###
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
@ -8,8 +8,15 @@ if [[ -z $1 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
env_list='\$PRODUCTION \$API_URL \$IRB_URL \$HOME_ROUTE \$PORT0'
|
# The second parameter is a comma-delimited list of environment variable names
|
||||||
for file_path in $(echo $1 | sed "s/,/ /g")
|
if [[ -z $2 ]]; then
|
||||||
|
echo 'ERROR: No environment variables given.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Convert "VAR1,VAR2,VAR3,..." to "\$VAR1 \$VAR2 \$VAR3 ..."
|
||||||
|
env_list="\\\$${2//,/ \\\$}" # "\" and "$" are escaped as "\\" and "\$"
|
||||||
|
for file_path in ${1//,/ }
|
||||||
do
|
do
|
||||||
echo "replacing $env_list in $file_path"
|
echo "replacing $env_list in $file_path"
|
||||||
|
|
||||||
@ -20,11 +27,10 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo 'Finished substituting environment variables.'
|
echo 'Finished substituting environment variables.'
|
||||||
echo "PRODUCTION = $PRODUCTION"
|
for env_var in ${2//,/ }
|
||||||
echo "API_URL = $API_URL"
|
do
|
||||||
echo "IRB_URL = $IRB_URL"
|
echo "$env_var = ${!env_var}"
|
||||||
echo "HOME_ROUTE = $HOME_ROUTE"
|
done
|
||||||
echo "PORT0 = $PORT0"
|
|
||||||
|
|
||||||
# Execute all other commands with parameters
|
# Execute all other commands with parameters
|
||||||
exec "${@:2}"
|
exec "${@:3}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user