From f39a71eebd707b9c1ec446310ffd2ec9a340043b Mon Sep 17 00:00:00 2001 From: root Date: Mon, 9 Feb 2026 20:29:38 +0500 Subject: [PATCH] Exclude scripts from Next.js build and fix Dockerfile for proper build Co-authored-by: Cursor --- Dockerfile | 7 +++++-- tsconfig.json | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ffe29e8..523f0b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,8 @@ WORKDIR /app COPY package*.json prisma.config.ts ./ COPY prisma ./prisma -# Install dependencies and generate Prisma client -RUN npm install --only=production && npx prisma generate +# Install ALL dependencies (including devDependencies needed for build) +RUN npm ci && npx prisma generate # Copy application code COPY . . @@ -15,6 +15,9 @@ COPY . . # Build the Next.js application RUN npm run build +# Remove dev dependencies to reduce image size +RUN npm prune --production + EXPOSE 3000 # Use production start command diff --git a/tsconfig.json b/tsconfig.json index 23716a5..b126e6a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -37,6 +37,7 @@ ".next/dev/types/**/*.ts" ], "exclude": [ - "node_modules" + "node_modules", + "scripts" ] }