Skip to content

Commit bfa86ad

Browse files
authored
Update Dockerfile to support Chromium Bug
1 parent 0cc8a2b commit bfa86ad

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

‎Dockerfile‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
# Use the official Node.js 20 Alpine image as a base
2-
FROM node:20-alpine
2+
FROM node:18.20.3
33

4+
# Install necessary dependencies for Puppeteer and Chromium
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
fonts-liberation \
7+
libasound2 \
8+
libatk-bridge2.0-0 \
9+
libatk1.0-0 \
10+
libcups2 \
11+
libdrm2 \
12+
libgbm1 \
13+
libgtk-3-0 \
14+
libnspr4 \
15+
libnss3 \
16+
libx11-xcb1 \
17+
libxcomposite1 \
18+
libxdamage1 \
19+
libxrandr2 \
20+
xdg-utils \
21+
libu2f-udev \
22+
libxshmfence1 \
23+
libglu1-mesa \
24+
chromium \
25+
&& apt-get clean \
26+
&& rm -rf /var/lib/apt/lists/*
27+
428
# Set the working directory in the container
529
WORKDIR /usr/src/app
630

@@ -16,5 +40,9 @@ COPY . .
1640
# Expose the port the app runs on
1741
EXPOSE 3000
1842

43+
# Puppeteer setup: Skip Chromium download and use the installed Chromium
44+
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
45+
ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"
46+
1947
# Command to run the application
20-
CMD [ "npm", "start" ]
48+
CMD [ "npm", "start" ]

0 commit comments

Comments
 (0)