From 34393eec76419fe1a8f3f4cb56f3f47ac6d2712e Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 21 Dec 2022 01:12:16 +0100 Subject: [PATCH] pg: also use firefox Dropping chromium reduced image size by ~500MB from 1.55GB to 1.04GB. --- Dockerfile | 4 ++-- prime-gaming.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 43269bf..b8d8092 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:focal ARG DEBIAN_FRONTEND=noninteractive # Playwright -ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true +# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD true # === INSTALL Node.js === @@ -47,7 +47,7 @@ COPY package*.json ./ # Install browser & dependencies only RUN npm install \ - && npx playwright install --with-deps firefox chromium \ + && npx playwright install --with-deps firefox \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/prime-gaming.js b/prime-gaming.js index 9f23d2d..09f036f 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -1,4 +1,4 @@ -import { chromium } from 'playwright'; // stealth plugin needs no outdated playwright-extra +import { firefox } from 'playwright'; // stealth plugin needs no outdated playwright-extra import path from 'path'; import { dirs, jsonDb, datetime, stealth, filenamify } from './util.js'; @@ -22,7 +22,7 @@ const run = { }; // https://playwright.dev/docs/auth#multi-factor-authentication -const context = await chromium.launchPersistentContext(dirs.browser, { +const context = await firefox.launchPersistentContext(dirs.browser, { // channel: 'chrome', // https://playwright.dev/docs/browsers#google-chrome--microsoft-edge, chrome will not work on arm64 linux, only chromium which is the default headless, viewport: { width: 1280, height: 1280 },