diff --git a/docker-compose.yaml b/docker-compose.yaml index c767b57f2..cef40c81e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -60,7 +60,7 @@ services: args: TURBO_FILTER: "@edr/passenger-portal" APP_PATH: apps/edr-passenger-web/portal - VITE_API_URL: ${PASSENGER_VITE_API_URL:-http://localhost:4000} + NEXT_PUBLIC_API_URL: ${PASSENGER_API_URL:-http://localhost:4000} secrets: - npmrc ports: @@ -73,7 +73,7 @@ services: args: TURBO_FILTER: "@edr/passenger-backoffice" APP_PATH: apps/edr-passenger-web/backoffice - VITE_API_URL: ${PASSENGER_VITE_API_URL:-http://localhost:4000} + NEXT_PUBLIC_API_URL: ${PASSENGER_API_URL:-http://localhost:4000} secrets: - npmrc ports: diff --git a/infrastructure/docker/Dockerfile.web b/infrastructure/docker/Dockerfile.web index eb02e0e19..f385206e5 100644 --- a/infrastructure/docker/Dockerfile.web +++ b/infrastructure/docker/Dockerfile.web @@ -3,6 +3,7 @@ ARG TURBO_FILTER=@edr/freight-portal ARG APP_PATH=apps/edr-freight-web/portal ARG VITE_API_URL=http://localhost:3001/api +ARG NEXT_PUBLIC_API_URL=http://localhost:4000 FROM node:24.15.0-alpine AS base RUN apk add --no-cache libc6-compat @@ -25,7 +26,9 @@ FROM base AS builder ARG TURBO_FILTER ARG APP_PATH ARG VITE_API_URL +ARG NEXT_PUBLIC_API_URL ENV VITE_API_URL=${VITE_API_URL} +ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} COPY --from=installer /app/ . COPY --from=pruner /app/out/full/ . @@ -41,8 +44,8 @@ RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm turbo build --filter="${TURBO_ exit 1) # Verify build output exists before proceeding -RUN if [ ! -d "/app/${APP_PATH}/dist" ]; then \ - echo "ERROR: Build output directory not found at /app/${APP_PATH}/dist"; \ +RUN if [ ! -d "/app/${APP_PATH}/dist" ] && [ ! -d "/app/${APP_PATH}/out" ]; then \ + echo "ERROR: Build output directory not found at /app/${APP_PATH}/dist or /app/${APP_PATH}/out"; \ echo "Contents of /app/${APP_PATH}:"; \ ls -la /app/${APP_PATH}/ 2>/dev/null || echo "Directory does not exist"; \ exit 1; \