-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (39 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
48 lines (39 loc) · 1.08 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Use Node.js 20 slim base image
FROM node:20-slim
# Install system dependencies including Chromium
RUN apt-get update && apt-get install -y \
chromium \
fonts-liberation \
libappindicator3-1 \
libasound2 \
libatk-bridge2.0-0 \
libdrm2 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libxss1 \
libxtst6 \
xdg-utils \
wget \
ca-certificates \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json pnpm-lock.yaml ./
# Install pnpm globally
RUN npm install -g pnpm
# Approve puppeteer build scripts and install dependencies
RUN pnpm config set auto-install-peers true \
&& pnpm config set ignore-scripts false \
&& pnpm install --frozen-lockfile --prod
# Copy application code
COPY . .
# Set environment variables for Puppeteer
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Expose port
EXPOSE 3001
# Start the application without --env-file flag (use environment variables directly)
CMD ["node", "src/index.js"]