Create Dockerfile
Browse files- Dockerfile +41 -0
Dockerfile
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Base image with Node.js and Puppeteer dependencies
|
2 |
+
FROM node:20-slim
|
3 |
+
|
4 |
+
# Install dependencies required for Puppeteer
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
libnss3 \
|
7 |
+
libatk1.0-0 \
|
8 |
+
libpangocairo-1.0-0 \
|
9 |
+
libx11-xcb1 \
|
10 |
+
libxcomposite1 \
|
11 |
+
libxcursor1 \
|
12 |
+
libxdamage1 \
|
13 |
+
libxfixes3 \
|
14 |
+
libxi6 \
|
15 |
+
libxrandr2 \
|
16 |
+
libxrender1 \
|
17 |
+
libxss1 \
|
18 |
+
libxtst6 \
|
19 |
+
ca-certificates \
|
20 |
+
fonts-liberation \
|
21 |
+
libasound2 \
|
22 |
+
libgbm1 \
|
23 |
+
libgtk-3-0 \
|
24 |
+
xdg-utils \
|
25 |
+
&& rm -rf /var/lib/apt/lists/*
|
26 |
+
|
27 |
+
# Set working directory
|
28 |
+
WORKDIR /app
|
29 |
+
|
30 |
+
# Copy package.json and install dependencies
|
31 |
+
COPY package.json package-lock.json ./
|
32 |
+
RUN npm install
|
33 |
+
|
34 |
+
# Run npx to install Puppeteer manually
|
35 |
+
RUN npx install puppeteer
|
36 |
+
|
37 |
+
# Copy project files
|
38 |
+
COPY . .
|
39 |
+
|
40 |
+
# Start script
|
41 |
+
CMD ["node", "index.js"]
|