fixing some docker issues

This commit is contained in:
orangecoding
2026-03-22 09:41:20 +01:00
parent 8501fc7266
commit a1289acf15
4 changed files with 36 additions and 26 deletions

View File

@@ -47,12 +47,17 @@ export async function launchBrowser(url, options) {
removeUserDataDir = true;
}
// On ARM64 Docker, Chrome for Testing has no native binary — use system Chromium instead.
const executablePath =
options?.executablePath ||
(process.arch === 'arm64' && process.env.IS_DOCKER === 'true' ? '/usr/bin/chromium' : undefined);
const browser = await puppeteer.launch({
headless: options?.puppeteerHeadless ?? true,
args: launchArgs,
timeout: options?.puppeteerTimeout || 45_000,
userDataDir,
executablePath: options?.executablePath,
executablePath,
});
browser.__fredy_userDataDir = userDataDir;