File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change 1- FROM node:20-alpine AS builder
1+ FROM node:20-slim AS deps
22WORKDIR /app
33
4- COPY package.json package-lock.json ./
5- RUN npm ci
4+ # Copy package files
5+ COPY package.json package-lock.json* ./
66
7+ # Install production dependencies only
8+ RUN npm ci --omit=dev --legacy-peer-deps --ignore-scripts
9+
10+ FROM node:20-slim AS builder
11+ WORKDIR /app
12+
13+ # Copy package files
14+ COPY package.json package-lock.json* ./
15+
16+ # Install all dependencies (including dev)
17+ RUN HUSKY=0 npm ci --legacy-peer-deps
18+
19+ # Copy sources and build
720COPY tsconfig.json ./
821COPY src ./src
922COPY README.md ./README.md
1023RUN npm run build
1124
12- FROM node:20-alpine AS runner
25+ FROM node:20-slim AS runner
1326ENV NODE_ENV=production
1427WORKDIR /app
1528
16- COPY package.json package-lock.json ./
17- RUN npm ci --omit=dev --ignore-scripts
29+ # Copy production node_modules and built app
30+ COPY --from=deps /app/node_modules ./node_modules
1831COPY --from=builder /app/dist ./dist
32+ COPY --from=builder /app/package.json ./
1933
2034ENV HOST=0.0.0.0 \
2135 PORT=3000
2236
2337EXPOSE 3000
2438
2539CMD ["node" , "dist/index.js" , "--http" ]
26-
27-
You can’t perform that action at this time.
0 commit comments