feat: Introduce dedicated settings page with API URL configuration and data management hooks, and update Dockerfile for runtime env injection.
This commit is contained in:
@@ -19,9 +19,15 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Create script to generate env-config.js from environment variables
|
||||
RUN echo '#!/bin/sh' > /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo 'echo "window.env = {" > /usr/share/nginx/html/env-config.js' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo 'if [ -n "$API_URL" ]; then echo " API_URL: \"$API_URL\"," >> /usr/share/nginx/html/env-config.js; fi' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo 'echo "};" >> /usr/share/nginx/html/env-config.js' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo 'cat > /usr/share/nginx/html/env-config.js << EOF' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo '// Runtime environment configuration' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo '// Generated at container startup' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo 'window.env = {' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo 'EOF' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo 'if [ -n "$API_URL" ]; then' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo ' echo " API_URL: \"$API_URL\"," >> /usr/share/nginx/html/env-config.js' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo 'fi' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
echo 'echo "};\" >> /usr/share/nginx/html/env-config.js' >> /docker-entrypoint.d/40-env-config.sh && \
|
||||
chmod +x /docker-entrypoint.d/40-env-config.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user