-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
21 lines (17 loc) · 1.18 KB
/
docker-entrypoint.sh
File metadata and controls
21 lines (17 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e
echo "Startup script"
echo "Replacing environment variables in built files..."
# Replace placeholders with env vars or defaults only in the built files
find /app/packages/client/dist -type f \( -name "*.html" -o -name "*.js" -o -name "*.css" -o -name "*.map" -o -name "*.json" \) | xargs sed -i \
-e "s|%APP_TITLE%|${APP_TITLE:-STAC Manager}|g" \
-e "s|%APP_DESCRIPTION%|${APP_DESCRIPTION:-A web application for managing STAC catalogs}|g" \
-e "s|%PUBLIC_URL%|${PUBLIC_URL:-http://127.0.0.1:8080}|g" \
-e "s|%REACT_APP_STAC_API%|${REACT_APP_STAC_API:-https://earth-search.aws.element84.com/v0}|g" \
-e "s|%REACT_APP_STAC_BROWSER%|${REACT_APP_STAC_BROWSER:-https://radiantearth.github.io/stac-browser/#/external/$(echo ${REACT_APP_STAC_API:-earth-search.aws.element84.com/v0} | sed 's|^https://||')}|g" \
-e "s|%REACT_APP_OIDC_AUTHORITY%|${REACT_APP_OIDC_AUTHORITY:-}|g" \
-e "s|%REACT_APP_OIDC_CLIENT_ID%|${REACT_APP_OIDC_CLIENT_ID:-}|g" \
-e "s|%REACT_APP_THEME_PRIMARY_COLOR%|${REACT_APP_THEME_PRIMARY_COLOR:-#6A5ACD}|g" \
-e "s|%REACT_APP_THEME_SECONDARY_COLOR%|${REACT_APP_THEME_SECONDARY_COLOR:-#048A81}|g"
echo "Environment variable replacement complete"
exec "$@"