npm.apple.com causes silent install failures for devDependencies inside the Docker build context. Explicitly use registry.npmjs.org for the builder stage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
602 B
Docker
19 lines
602 B
Docker
# Stage 1: build TypeScript + install all deps
|
|
FROM node:20-slim AS builder
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN NODE_ENV=development npm install --registry https://registry.npmjs.org
|
|
COPY tsconfig.json ./
|
|
COPY src ./src
|
|
RUN ./node_modules/.bin/tsc && npm prune --production
|
|
|
|
# Stage 2: runtime with Playwright — copy built artifacts, no npm install
|
|
FROM mcr.microsoft.com/playwright:v1.47.0-jammy
|
|
WORKDIR /app
|
|
RUN npx playwright install chromium --with-deps
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/dist ./dist
|
|
|
|
CMD ["node", "dist/index.js"]
|
|
|