Exclude scripts from Next.js build and fix Dockerfile for proper build

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
root 2026-02-09 20:29:38 +05:00
parent 8a160ce6af
commit f39a71eebd
2 changed files with 7 additions and 3 deletions

View File

@ -6,8 +6,8 @@ WORKDIR /app
COPY package*.json prisma.config.ts ./ COPY package*.json prisma.config.ts ./
COPY prisma ./prisma COPY prisma ./prisma
# Install dependencies and generate Prisma client # Install ALL dependencies (including devDependencies needed for build)
RUN npm install --only=production && npx prisma generate RUN npm ci && npx prisma generate
# Copy application code # Copy application code
COPY . . COPY . .
@ -15,6 +15,9 @@ COPY . .
# Build the Next.js application # Build the Next.js application
RUN npm run build RUN npm run build
# Remove dev dependencies to reduce image size
RUN npm prune --production
EXPOSE 3000 EXPOSE 3000
# Use production start command # Use production start command

View File

@ -37,6 +37,7 @@
".next/dev/types/**/*.ts" ".next/dev/types/**/*.ts"
], ],
"exclude": [ "exclude": [
"node_modules" "node_modules",
"scripts"
] ]
} }