reikernx commited on
Commit
7f592b6
·
verified ·
1 Parent(s): 4ca25f0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -9
Dockerfile CHANGED
@@ -1,17 +1,49 @@
1
- # Use Node.js 20 base image
2
- FROM node:20
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy your server.js file into the container
8
- COPY server.js .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
- # Install dependencies inline (no package.json)
11
- RUN npm install express axios cheerio
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
- # Expose the app port
14
  EXPOSE 7860
15
 
16
- # Run the app
17
  CMD ["node", "server.js"]
 
1
+ FROM node:18
 
2
 
 
3
  WORKDIR /app
4
 
5
+ RUN apt-get update && apt-get install -y \
6
+ wget \
7
+ curl \
8
+ unzip \
9
+ fonts-liberation \
10
+ libasound2 \
11
+ libatk-bridge2.0-0 \
12
+ libatk1.0-0 \
13
+ libcups2 \
14
+ libdbus-1-3 \
15
+ libgbm-dev \
16
+ libnspr4 \
17
+ libnss3 \
18
+ libxcomposite1 \
19
+ libxdamage1 \
20
+ libxfixes3 \
21
+ libxrandr2 \
22
+ xdg-utils \
23
+ libu2f-udev \
24
+ libvulkan1 \
25
+ xvfb \
26
+ ca-certificates \
27
+ git \
28
+ --no-install-recommends && \
29
+ rm -rf /var/lib/apt/lists/*
30
 
31
+ RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /usr/share/keyrings/google-chrome-keyring.gpg \
32
+ && echo 'deb [signed-by=/usr/share/keyrings/google-chrome-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list \
33
+ && apt-get update \
34
+ && apt-get install -y google-chrome-stable
35
+
36
+ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome \
37
+ PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
38
+ PUPPETEER_CACHE_DIR=/tmp/puppeteer_cache \
39
+ NODE_ENV=production
40
+
41
+ COPY . /app
42
+
43
+ RUN npm install string-similarity puppeteer puppeteer-extra puppeteer-extra-plugin-stealth express axios qs cors
44
+
45
+ RUN npx puppeteer install
46
 
 
47
  EXPOSE 7860
48
 
 
49
  CMD ["node", "server.js"]