diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index 3a406b2..ef50b17 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -12,6 +12,12 @@ RUN npm install # Copy source code COPY . . +# Accept build arguments for API and app URLs +ARG VITE_API_BASE_URL +ARG VITE_APP_URL +ENV VITE_API_BASE_URL=${VITE_API_BASE_URL} +ENV VITE_APP_URL=${VITE_APP_URL} + # Build production bundle RUN npm run build diff --git a/docker-compose.traefik.yml b/docker-compose.traefik.yml index 618afc5..ccddc4d 100644 --- a/docker-compose.traefik.yml +++ b/docker-compose.traefik.yml @@ -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}} diff --git a/docker-compose.yml b/docker-compose.yml index e1be84c..bbcafb0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -71,6 +71,8 @@ services: build: context: ./apps/web dockerfile: Dockerfile + args: + VITE_API_BASE_URL: http://localhost:8000 container_name: hq-web environment: VITE_API_BASE_URL: http://localhost:8000