File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,18 @@ ENV NODE_ENV=production
5
5
# Set working directory
6
6
WORKDIR /app
7
7
8
+ # We don't need the standalone Chromium
9
+ ENV PUPPETEER_SKIP_DOWNLOAD true
10
+
11
+ # Install Google Chrome Stable and fonts
12
+ # Note: this installs the necessary libs to make the browser work with Puppeteer.
13
+ RUN apt-get update && apt-get install gnupg wget -y && \
14
+ wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
15
+ sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
16
+ apt-get update && \
17
+ apt-get install google-chrome-stable -y --no-install-recommends && \
18
+ rm -rf /var/lib/apt/lists/*
19
+
8
20
# Install dependencies
9
21
COPY package.json package-lock.json ./
10
22
RUN npm ci --omit=dev
Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ const puppeteer = require("puppeteer");
7
7
* Extracts the relevant information from the course page
8
8
*/
9
9
async function extractRating ( url ) {
10
- const browser = await puppeteer . launch ( ) ;
10
+ const browser = await puppeteer . launch ( {
11
+ executablePath : "/usr/bin/google-chrome" ,
12
+ } ) ;
11
13
12
14
const page = await browser . newPage ( ) ;
13
15
await page . goto ( url , { waitUntil : "networkidle2" } ) ;
You can’t perform that action at this time.
0 commit comments