fix: Chromium 添加 --no-sandbox 等 Docker 必要参数

This commit is contained in:
2026-03-01 00:40:03 +08:00
parent 5489c0bb50
commit a767400400
+6
View File
@@ -279,6 +279,12 @@ export class BrowserManager {
const browser = await chromium.launch({
headless: config.headless,
...(config.browserBin ? { executablePath: config.browserBin } : {}),
args: [
'--no-sandbox', // Required in Docker (no user namespaces)
'--disable-setuid-sandbox',
'--disable-dev-shm-usage', // Use /tmp instead of /dev/shm
'--disable-gpu',
],
});
// React to unexpected disconnects (e.g. browser crash, OOM kill).