Amend CORS
This commit is contained in:
@@ -18,13 +18,13 @@ RUN mkdir -p /runtime-config && \
|
||||
USER nginx
|
||||
|
||||
# Copy built assets
|
||||
COPY --from=builder --chown=nginx:nginx /app/dist /usr/share/nginx/html
|
||||
COPY --chown=nginx:nginx dist /usr/share/nginx/html
|
||||
|
||||
# Copy our custom nginx config
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
# Copy nginx config template
|
||||
COPY --chown=nginx:nginx nginx.conf.template /etc/nginx/templates/
|
||||
|
||||
# Copy entrypoint script
|
||||
COPY docker/entrypoint.sh /entrypoint.sh
|
||||
COPY --chown=nginx:nginx docker/entrypoint.sh /entrypoint.sh
|
||||
|
||||
# Make entrypoint executable
|
||||
USER root
|
||||
|
||||
@@ -4,10 +4,16 @@ set -e
|
||||
# Create runtime config file in writable location
|
||||
cat > /runtime-config/config.js <<EOF
|
||||
window.__APP_CONFIG__ = {
|
||||
API_BASE_URL: "${API_BASE_URL}",
|
||||
OTHER_VAR: "${OTHER_VAR}"
|
||||
API_BASE_URL: "${API_BASE_URL}"
|
||||
};
|
||||
EOF
|
||||
|
||||
# Generate nginx config from template (if using)
|
||||
if [ -f "/etc/nginx/templates/nginx.conf.template" ]; then
|
||||
envsubst '${API_BASE_URL}' \
|
||||
< /etc/nginx/templates/nginx.conf.template \
|
||||
> /etc/nginx/nginx.conf
|
||||
fi
|
||||
|
||||
# Start Nginx
|
||||
exec nginx -g "daemon off;"
|
||||
Reference in New Issue
Block a user