From 03099b2d1291512eeb86fa5ea73086232bf27c01 Mon Sep 17 00:00:00 2001 From: TenX PM Date: Mon, 4 May 2026 20:17:06 +0000 Subject: [PATCH] fix: Dockerfile - inline NODE_ENV=dev for npm ci, production for next build --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f30b0a2..abaf955 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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