Add backend URL configuration for frontend and update nginx setup
- Added BACKEND_URL environment variable to docker-compose for frontend service. - Introduced a new entrypoint script to configure nginx with the BACKEND_URL at runtime. - Created a template for nginx configuration to handle API and WebSocket requests dynamically. - Updated README with instructions for configuring reverse proxy setups. Fixes #12
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#!/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
|
||||
|
||||
# Execute the main command (nginx)
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user