Update frontend
This commit is contained in:
parent
b4008f5b93
commit
02541a62ea
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
# Don't use set -e to avoid crashing if chown fails
|
||||||
|
|
||||||
# Generate env.js from API_BASE environment variable
|
# Generate env.js from API_BASE environment variable
|
||||||
# This is set in the Helm deployment values
|
# This is set in the Helm deployment values
|
||||||
@ -9,7 +9,7 @@ TARGET="/usr/share/nginx/html/env.js"
|
|||||||
# Default to /api as fallback (relative path)
|
# Default to /api as fallback (relative path)
|
||||||
: ${API_BASE:=/api}
|
: ${API_BASE:=/api}
|
||||||
|
|
||||||
echo "Generating env.js with API_BASE=${API_BASE}"
|
echo "[ENTRYPOINT] Generating env.js with API_BASE=${API_BASE}"
|
||||||
|
|
||||||
cat > "$TARGET" <<EOF
|
cat > "$TARGET" <<EOF
|
||||||
window.__ENV__ = {
|
window.__ENV__ = {
|
||||||
@ -17,7 +17,15 @@ window.__ENV__ = {
|
|||||||
};
|
};
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "✓ env.js generated at $TARGET"
|
if [ -f "$TARGET" ]; then
|
||||||
|
echo "[ENTRYPOINT] ✓ env.js generated successfully at $TARGET"
|
||||||
|
cat "$TARGET"
|
||||||
|
else
|
||||||
|
echo "[ENTRYPOINT] ✗ Failed to generate env.js"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Ensure ownership/permissions for nginx
|
# Ensure ownership/permissions for nginx (don't fail if this doesn't work)
|
||||||
chown -R nginx:nginx /usr/share/nginx/html || true
|
chown nginx:nginx /usr/share/nginx/html/env.js 2>/dev/null || echo "[ENTRYPOINT] Note: Could not change ownership (not critical)"
|
||||||
|
|
||||||
|
echo "[ENTRYPOINT] env.js setup complete"
|
||||||
|
|||||||
@ -28,8 +28,9 @@ COPY --from=builder /app/dist /usr/share/nginx/html
|
|||||||
# This will run before nginx starts and generate env.js from API_BASE env var
|
# This will run before nginx starts and generate env.js from API_BASE env var
|
||||||
COPY 10-generate-env.sh /docker-entrypoint.d/10-generate-env.sh
|
COPY 10-generate-env.sh /docker-entrypoint.d/10-generate-env.sh
|
||||||
|
|
||||||
# Ensure entrypoint script is executable
|
# Ensure entrypoint script is executable and has correct line endings
|
||||||
RUN chmod +x /docker-entrypoint.d/10-generate-env.sh
|
RUN chmod +x /docker-entrypoint.d/10-generate-env.sh && \
|
||||||
|
sed -i 's/\r$//' /docker-entrypoint.d/10-generate-env.sh
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user