Allow for Screenshot within Docker

Chromium in Docker needs to be startet without sandbox or screenshot will fail.
This commit is contained in:
Marco Ochse 2023-09-12 11:01:49 +02:00 committed by GitHub
parent afc5b54207
commit 2bce29e3cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ const handler = async (targetUrl) => {
let browser = null;
try {
browser = await puppeteer.launch({
args: chromium.args,
args: [...chromium.args, '--no-sandbox'], // Add --no-sandbox flag
defaultViewport: { width: 800, height: 600 },
executablePath: process.env.CHROME_PATH || await chromium.executablePath,
headless: chromium.headless,