diff --git a/frontend/10-generate-env.sh b/frontend/10-generate-env.sh index 0fbacc6..222fab2 100644 --- a/frontend/10-generate-env.sh +++ b/frontend/10-generate-env.sh @@ -1,7 +1,8 @@ #!/bin/sh set -e -TEMPLATE="/etc/env/env.js.template" +# Template is in dist (copied by Dockerfile builder stage) +TEMPLATE="/usr/share/nginx/html/env.js.template" TARGET="/usr/share/nginx/html/env.js" if [ -f "$TEMPLATE" ]; then @@ -16,8 +17,16 @@ window.__ENV__ = { EOF echo "✓ env.js generated at $TARGET" else - echo "No env.js.template found at $TEMPLATE, skipping generation" + echo "Warning: env.js.template not found at $TEMPLATE, creating default env.js" + # Fallback: create env.js with default value + : ${API_BASE:=/api} + cat > "$TARGET" <