Exclude scripts from Next.js build and fix Dockerfile for proper build
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8a160ce6af
commit
f39a71eebd
@ -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
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
".next/dev/types/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
"node_modules",
|
||||
"scripts"
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user