Frontend first draft
This commit is contained in:
25
frontend/pweb/entrypoint.sh
Executable file
25
frontend/pweb/entrypoint.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
replace_env_var() {
|
||||
local var_name=$1
|
||||
local placeholder="%%$var_name%%"
|
||||
local value=$(eval echo \$$var_name)
|
||||
# inject value to the index.html
|
||||
sed -i "s|$placeholder|$value|g" /usr/share/pweb/index.html
|
||||
}
|
||||
|
||||
echo "Starting Container"
|
||||
|
||||
replace_env_var "WS_PROTOCOL"
|
||||
replace_env_var "WS_ENDPOINT"
|
||||
replace_env_var "API_PROTOCOL"
|
||||
replace_env_var "SERVICE_HOST"
|
||||
replace_env_var "API_ENDPOINT"
|
||||
replace_env_var "AMPLITUDE_SECRET"
|
||||
replace_env_var "DEFAULT_LOCALE"
|
||||
replace_env_var "DEFAULT_CURRENCY"
|
||||
|
||||
echo "Passing by launch command"
|
||||
# Execute the passed command (e.g., starting Nginx)
|
||||
# exec "$@"
|
||||
exec nginx -g 'daemon off;'
|
||||
Reference in New Issue
Block a user