Skip to content

Commit ada9f90

Browse files
committed
Alter setup to use chromium base
1 parent 7028f56 commit ada9f90

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

Diff for: Dockerfile

+2-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ WORKDIR /app
88
# We don't need the standalone Chromium
99
ENV PUPPETEER_SKIP_DOWNLOAD true
1010

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/*
11+
# Install Chromium manually
12+
RUN apk add --no-cache \ chromium
1913

2014
# Install dependencies
2115
COPY package.json package-lock.json ./

Diff for: commands/courseRating.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ const puppeteer = require("puppeteer");
88
*/
99
async function extractRating(url) {
1010
const browser = await puppeteer.launch({
11-
executablePath: "/usr/bin/google-chrome",
11+
headless: true,
12+
args: ["--no-sandbox", "--disable-setuid-sandbox"],
13+
executablePath: "/usr/bin/chromium",
1214
});
1315

1416
const page = await browser.newPage();

0 commit comments

Comments
 (0)