fix: use node:20-alpine in sync builder, matching backend Dockerfile
node:20-slim picks up the Apple npm proxy which blocks installs. node:20-alpine does not. Also add PATH for node_modules/.bin so tsc is found, and remove committed dist/ since the build now works properly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
# dist/ is compiled locally and committed to the repo.
|
||||
# The server npm proxy blocks devDependency installs inside Docker.
|
||||
# Stage 1: build TypeScript
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache python3 make g++
|
||||
COPY package*.json ./
|
||||
RUN npm ci --include=dev
|
||||
ENV PATH="/app/node_modules/.bin:$PATH"
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN npm run build && npm prune --production
|
||||
|
||||
# Stage 2: runtime with Playwright
|
||||
FROM mcr.microsoft.com/playwright:v1.47.0-jammy
|
||||
WORKDIR /app
|
||||
RUN npx playwright install chromium --with-deps
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm install --omit=dev --registry https://registry.npmjs.org
|
||||
COPY dist ./dist
|
||||
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