fix: pass Vite env vars as Docker build args
Vite reads env vars at build time, not runtime. The previous setup only set them in docker-compose 'environment' which is only available at container runtime. Now they are passed as build args so Vite can embed the correct API URL during the build process. - Add build args to web service in both compose files - Update Dockerfile to accept ARGs and set ENV for Vite - Fixes login redirect always going to localhost:8000
This commit is contained in:
@@ -89,6 +89,9 @@ services:
|
||||
build:
|
||||
context: ./apps/web
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
VITE_API_BASE_URL: ${API_PUBLIC_URL:-https://${API_DOMAIN}}
|
||||
VITE_APP_URL: ${WEB_PUBLIC_URL:-https://${WEB_DOMAIN}}
|
||||
container_name: hq-web
|
||||
environment:
|
||||
VITE_API_BASE_URL: ${API_PUBLIC_URL:-https://${API_DOMAIN}}
|
||||
|
||||
Reference in New Issue
Block a user