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 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
|
||||||
|
|||||||
@ -37,6 +37,7 @@
|
|||||||
".next/dev/types/**/*.ts"
|
".next/dev/types/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules",
|
||||||
|
"scripts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user