Skip to content

Commit da4e542

Browse files
committed
Modification to installation order
1 parent 132b068 commit da4e542

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

Dockerfile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,11 @@
22
FROM node:20.15.0-slim as builder
33
ENV NODE_ENV=production
44

5-
# We don't need the standalone Chromium
6-
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
7-
8-
# Install Google Chrome Stable and fonts
9-
# Note: this installs the necessary libs to make the browser work with Puppeteer.
10-
RUN apt-get update && apt-get install gnupg wget -y && \
11-
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
12-
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
13-
apt-get update && \
14-
apt-get install google-chrome-stable -y --no-install-recommends && \
15-
rm -rf /var/lib/apt/lists/*
16-
175
# Set working directory
186
WORKDIR /app
197

8+
RUN apt-get update && apt-get install libgbm1 && apt-get install libasound2
9+
2010
# Install dependencies
2111
COPY package.json package-lock.json ./
2212
RUN npm ci --omit=dev

commands/courseRating.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ 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({
11-
executablePath: "/usr/bin/google-chrome",
12-
});
10+
const browser = await puppeteer.launch();
1311

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

entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#!/bin/sh
2+
node node_modules/puppeteer/install.js
3+
24
node deploy-commands.js
35
node index.js

0 commit comments

Comments
 (0)