fix: use npm install and explicit package-lock.json COPY in sync Dockerfile
Avoids stale Docker layer cache issue where tsc was not found because an old npm ci layer (without dev deps) was cached on the build host. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# Stage 1: build TypeScript + install all deps
|
||||
FROM node:20-slim AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --include=dev
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm install
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN ./node_modules/.bin/tsc && npm prune --production
|
||||
@@ -15,3 +15,4 @@ COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
CMD ["node", "dist/index.js"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user