From 92a5cd9479aae279775f31b997345905e7518af2 Mon Sep 17 00:00:00 2001 From: Gregory Bell Date: Wed, 3 Jul 2024 16:30:40 -0600 Subject: [PATCH] Add xserver to docker image; set sandbox info correctly --- Dockerfile | 6 ++++-- src/run.ts | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb54548..dc85129 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,10 @@ ADD . /app RUN npm run bundle -FROM ghcr.io/puppeteer/puppeteer:16.1.0 AS dist +FROM ghcr.io/puppeteer/puppeteer:22.10.0 AS dist + +RUN apt-get install -y libgbm-dev xvfb COPY --from=builder /app/dist /dist -ENTRYPOINT ["node", "/dist/index.js"] +ENTRYPOINT [ "xvfb-run", "--server-args='-screen 0 1200x800x24'", "node", "/dist/index.js"] diff --git a/src/run.ts b/src/run.ts index f58740e..a1a86dc 100644 --- a/src/run.ts +++ b/src/run.ts @@ -22,8 +22,9 @@ export async function run( headless: false, executablePath: chrome_path, args: [ - // `--no-sandbox`, - // `--headless`, + `--no-sandbox`, + // `--headless` + `--disable-setuid-sandbox`, `--disable-gpu`, `--disable-dev-shm-usage`, ],