-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.sh
More file actions
31 lines (19 loc) · 797 Bytes
/
entrypoint.sh
File metadata and controls
31 lines (19 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
set -e
node ../confd/generate-config.js --indocker
# Check if env-config.js contains "{{" or has size 0
if grep -q '{{' env-config.js || [ ! -s env-config.js ]; then
echo "Error: env-config.js contains '{{' or is empty"
exit 1
fi
# Check if index.html contains "{{" or has size 0
if grep -q '{{' index.html || [ ! -s index.html ]; then
echo "Error: index.html contains '{{' or is empty"
exit 1
fi
echo "Done with confd"
echo "Running SED command -->" 's/{PUBLIC_URL_PLACEHOLDER}/'"$(echo "$CONFIGURATION_PUBLIC_URL" | sed 's/[^a-zA-Z0-9.]/\\&/g')"'/g'
sed -i 's/{PUBLIC_URL_PLACEHOLDER}/'"$(echo "$CONFIGURATION_PUBLIC_URL" | sed 's/[^a-zA-Z0-9.]/\\&/g')"'/g' ./static/js/main.*.js
echo "Done with SED command"
echo "Running NGINX ..."
nginx -g 'daemon off;'