-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (18 loc) · 817 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (18 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM node:20-bookworm-slim
WORKDIR /app
# Build tools for native modules + playwright system deps (Debian/bookworm)
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 make g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy manifests and install prod deps fresh (no layer reuse from prior Alpine builds)
COPY package*.json ./
RUN npm ci --no-fund --no-audit --omit=dev && npm cache clean --force
# Install Chromium and all its system dependencies via playwright's own installer.
# Use node directly to avoid PATH/npx resolution issues in Docker build context.
# --with-deps uses apt-get; works on Debian/bookworm only (not Alpine).
RUN node node_modules/playwright/cli.js install chromium --with-deps
COPY . .
ENV NODE_ENV=production
ENV PORT=5000
EXPOSE 5000
CMD ["node", "app.js"]