Skip to content

Commit

Permalink
Modification to installation order
Browse files Browse the repository at this point in the history
  • Loading branch information
Domin0de committed Jun 29, 2024
1 parent 132b068 commit da4e542
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@
FROM node:20.15.0-slim as builder
ENV NODE_ENV=production

# We don't need the standalone Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && \
apt-get install google-chrome-stable -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

RUN apt-get update && apt-get install libgbm1 && apt-get install libasound2

# Install dependencies
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
Expand Down
4 changes: 1 addition & 3 deletions commands/courseRating.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ const puppeteer = require("puppeteer");
* Extracts the relevant information from the course page
*/
async function extractRating(url) {
const browser = await puppeteer.launch({
executablePath: "/usr/bin/google-chrome",
});
const browser = await puppeteer.launch();

const page = await browser.newPage();
await page.goto(url, { waitUntil: "networkidle2" });
Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh
node node_modules/puppeteer/install.js

node deploy-commands.js
node index.js

0 comments on commit da4e542

Please sign in to comment.