File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -3,32 +3,38 @@ FROM node:20-alpine AS builder
33
44WORKDIR /app
55
6+ # Install pnpm
7+ RUN corepack enable && corepack prepare pnpm@latest --activate
8+
69# Copy package files
7- COPY package* .json ./
10+ COPY package.json pnpm-lock.yaml ./
811
912# Install dependencies
10- RUN npm ci
13+ RUN pnpm install --frozen-lockfile
1114
1215# Copy source code
1316COPY . .
1417
1518# Build the application
16- RUN npm run build
19+ RUN pnpm build
1720
1821# Production stage
1922FROM node:20-alpine AS production
2023
2124WORKDIR /app
2225
26+ # Install pnpm
27+ RUN corepack enable && corepack prepare pnpm@latest --activate
28+
2329# Create non-root user
2430RUN addgroup -g 1001 -S nodejs && \
2531 adduser -S typelets -u 1001
2632
2733# Copy package files
28- COPY package* .json ./
34+ COPY package.json pnpm-lock.yaml ./
2935
3036# Install only production dependencies
31- RUN npm ci --omit=dev && npm cache clean --force
37+ RUN pnpm install --frozen-lockfile --prod
3238
3339# Copy built application from builder stage
3440COPY --from=builder /app/dist ./dist
@@ -45,4 +51,4 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \
4551 CMD node -e "http.get('http://localhost:3000/', (res) => process.exit(res.statusCode === 200 ? 0 : 1))" || exit 1
4652
4753# Start the application
48- CMD ["npm " , "start" ]
54+ CMD ["pnpm " , "start" ]
You can’t perform that action at this time.
0 commit comments