fix: set ARG before COPY for VITE_API_BASE to work in build
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user