Reaperxxxx commited on
Commit
8295436
·
verified ·
1 Parent(s): b0db9b4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -9
Dockerfile CHANGED
@@ -1,11 +1,12 @@
1
- # Use an official Node.js runtime as a parent image
2
  FROM node:18
3
 
4
- # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
- # Install required dependencies (including Chromium)
8
  RUN apt-get update && apt-get install -y \
 
9
  libnss3 \
10
  libatk1.0-0 \
11
  libpangocairo-1.0-0 \
@@ -20,18 +21,19 @@ RUN apt-get update && apt-get install -y \
20
  libasound2 \
21
  libpango-1.0-0 \
22
  libatk-bridge2.0-0 \
23
- libgtk-3-0 \
24
- chromium
25
 
26
- # Install dependencies directly
27
- RUN npm install express axios cheerio puppeteer cors
28
 
29
- # Set Puppeteer to use system-installed Chromium
30
  ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
31
 
32
- # Copy the application code
33
  COPY . .
34
 
 
35
  EXPOSE 7860
36
 
 
37
  CMD ["node", "server.js"]
 
1
+ # Use an official Node.js runtime as base image
2
  FROM node:18
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install required dependencies (including Chromium for Playwright)
8
  RUN apt-get update && apt-get install -y \
9
+ wget \
10
  libnss3 \
11
  libatk1.0-0 \
12
  libpangocairo-1.0-0 \
 
21
  libasound2 \
22
  libpango-1.0-0 \
23
  libatk-bridge2.0-0 \
24
+ libgtk-3-0
 
25
 
26
+ # Install Node.js dependencies
27
+ RUN npm install express axios cheerio puppeteer-core playwright cors
28
 
29
+ # Set Puppeteer to use Playwright's Chromium
30
  ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
31
 
32
+ # Copy project files
33
  COPY . .
34
 
35
+ # Expose API port
36
  EXPOSE 7860
37
 
38
+ # Run the application
39
  CMD ["node", "server.js"]