Skip to content

Commit 064a2df

Browse files
committed
Update Dockerfile
fix target production build
1 parent c761be8 commit 064a2df

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ FROM base AS build
2020
ENV NODE_ENV=production
2121
# Install dependencies
2222
COPY package*.json ./
23-
RUN npm ci
23+
# Skip all lifecycle scripts including husky
24+
RUN npm install --ignore-scripts
2425
# Copy source code
2526
COPY . .
27+
# Build the application
28+
RUN npm run build
2629

2730
# Production stage
2831
FROM node:22-alpine AS production
@@ -32,8 +35,8 @@ WORKDIR /app
3235
COPY --from=build /app/dist ./dist
3336
COPY --from=build /app/package.json ./package.json
3437
# Install only production dependencies
35-
RUN npm ci --omit=dev
38+
RUN npm install --omit=dev --ignore-scripts
3639
# Expose production port
3740
EXPOSE 4321
3841
# Start production server
39-
CMD ["node", "./dist/server/entry.mjs"]
42+
CMD ["node", "./dist/server/entry.mjs"]

0 commit comments

Comments
 (0)