Skip to content

Commit 7028f56

Browse files
committed
Modify location and method for chromium install
1 parent e65eb61 commit 7028f56

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ ENV NODE_ENV=production
55
# Set working directory
66
WORKDIR /app
77

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+
820
# Install dependencies
921
COPY package.json package-lock.json ./
1022
RUN npm ci --omit=dev

commands/courseRating.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ const puppeteer = require("puppeteer");
77
* Extracts the relevant information from the course page
88
*/
99
async function extractRating(url) {
10-
const browser = await puppeteer.launch();
10+
const browser = await puppeteer.launch({
11+
executablePath: "/usr/bin/google-chrome",
12+
});
1113

1214
const page = await browser.newPage();
1315
await page.goto(url, { waitUntil: "networkidle2" });

0 commit comments

Comments
 (0)