Files
Sd416 26dff61c53 chore: improve Docker build and pin Node.js version
- Use multi-stage Docker build for smaller image size
- Pin Alpine to node:22-alpine3.21 for reproducible builds
- Use npm ci with package-lock.json for deterministic installs
- Add engines field requiring Node.js >=20
2025-12-05 20:25:14 +05:30

16 lines
384 B
Docker

# Build stage
FROM node:22-alpine3.21 AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . ./
# Production stage
FROM node:22-alpine3.21
WORKDIR /app
RUN apk add --no-cache chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
COPY --from=builder /app ./
CMD ["node", "--import", "tsx", "src/Main.ts"]