f9986513f8
- Moved BACKEND_URL configuration to the frontend service in the README. - Added validation for the generated nginx configuration in the entrypoint script. - Removed fallback nginx configuration copy from the Dockerfile. - Adjusted nginx template to ensure proper header formatting. This improves the deployment process and clarifies configuration instructions.
17 lines
529 B
Bash
17 lines
529 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# Set default backend URL if not provided
|
|
export BACKEND_URL="${BACKEND_URL:-backend:8000}"
|
|
|
|
echo "Configuring nginx with BACKEND_URL: ${BACKEND_URL}"
|
|
|
|
# Substitute environment variables in nginx config template
|
|
# Only substitute BACKEND_URL, preserve nginx variables like $http_upgrade
|
|
envsubst '${BACKEND_URL}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
|
|
|
|
# Validate the generated nginx configuration before starting
|
|
nginx -t -c /etc/nginx/nginx.conf
|
|
|
|
# Execute the main command (nginx)
|
|
exec "$@" |