From 44e2952fa1aeccec2dd95beddb0a64c9751bf421 Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 24 Nov 2025 01:13:38 +0100 Subject: [PATCH] fix: ensure Next.js build completes successfully in Dockerfile - Remove build error tolerance that was hiding failures - Add explicit check that .next directory exists after build - Force build to fail if .next is not created This ensures the Docker image always contains a valid Next.js build. --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 238bd58..62bf513 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,10 @@ ENV NEXT_PUBLIC_FACEBOOK_APP_ID=$NEXT_PUBLIC_FACEBOOK_APP_ID COPY package*.json ./ RUN npm ci COPY . . -# Build avec tolérance pour les erreurs SSR (pages client-side only) -RUN npm run build || (test -d .next && echo "Build completed with SSR warnings (expected for client-only pages)" || exit 1) +# Build Next.js - doit réussir pour continuer +RUN npm run build +# Vérifier que .next existe +RUN test -d .next || (echo "ERROR: .next directory not found after build!" && exit 1) # Étape 2 : Exécution FROM node:20-alpine AS runner