fix: set ARG before COPY for VITE_API_BASE to work in build

This commit is contained in:
2026-03-15 12:57:21 +00:00
parent 800a618aaa
commit fb02808666

View File

@@ -3,11 +3,14 @@ FROM node:20-alpine AS build
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
COPY . .
# Set build args and env vars BEFORE copying source code
ARG VITE_WIZARD_PORT=18080
ARG VITE_API_BASE
ENV VITE_WIZARD_PORT=$VITE_WIZARD_PORT
ENV VITE_API_BASE=$VITE_API_BASE
COPY . .
RUN npm run build
# Production stage — lightweight static server, no nginx