fix: Dockerfile - inline NODE_ENV=dev for npm ci, production for next build
This commit is contained in:
+5
-5
@@ -1,22 +1,22 @@
|
||||
# Stage 1: Build backend
|
||||
FROM node:20-alpine AS backend-builder
|
||||
WORKDIR /app/backend
|
||||
# Force dev deps install regardless of any injected NODE_ENV
|
||||
ENV NODE_ENV=development
|
||||
COPY backend/package*.json ./
|
||||
RUN npm ci --legacy-peer-deps --include=dev
|
||||
# Use inline NODE_ENV=development so devDeps (nest CLI) are installed
|
||||
# but the global NODE_ENV stays production for the actual build
|
||||
RUN NODE_ENV=development npm ci --legacy-peer-deps --include=dev
|
||||
COPY backend/ .
|
||||
RUN ./node_modules/.bin/nest build
|
||||
|
||||
# Stage 2: Build frontend
|
||||
FROM node:20-alpine AS frontend-builder
|
||||
WORKDIR /app/frontend
|
||||
ENV NODE_ENV=development
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm ci --legacy-peer-deps --include=dev
|
||||
RUN NODE_ENV=development npm ci --legacy-peer-deps --include=dev
|
||||
COPY frontend/ .
|
||||
ENV NEXT_PUBLIC_API_URL=/api-backend
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV NODE_ENV=production
|
||||
RUN npm run build
|
||||
|
||||
# Stage 3: Runtime
|
||||
|
||||
Reference in New Issue
Block a user