diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-02-06 10:52:23 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-02-06 10:52:23 +0200 |
| commit | c54bf575a8b75f4c1145c8284ad4a10909091b6d (patch) | |
| tree | 8661260e2d3cd39c74944d98350ff41663e74d9b /prod_bootstrap.sh | |
| parent | f7271130ceebe1fd2d184298fc2d1e892ab7d64f (diff) | |
Dockerize for prod
Diffstat (limited to 'prod_bootstrap.sh')
| -rwxr-xr-x | prod_bootstrap.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/prod_bootstrap.sh b/prod_bootstrap.sh new file mode 100755 index 0000000..c1de926 --- /dev/null +++ b/prod_bootstrap.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -euo pipefail +DIR="${1}" +VALID_ENV_KEYS=$(printenv | awk -F '=' '{ print $1 }' | tail | awk 'NF') + +for f in $(find ${DIR} -regex '.*\.js'); do + for envKey in ${VALID_ENV_KEYS}; do + replaced=$(printenv ${envKey}) + sed -i "s|%${envKey}|${replaced}|g" "${f}" + echo "[bootstrap] Replaced ${envKey} from container environment." + done +done + +nginx -g "daemon off;" |
