Skip to content

Commit

Permalink
Allow for Screenshot within Docker
Browse files Browse the repository at this point in the history
Chromium in Docker needs to be startet without sandbox or screenshot will fail.
  • Loading branch information
t3chn0m4g3 authored Sep 12, 2023
1 parent afc5b54 commit 2bce29e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2bce29e

Please sign in to comment.