Config tweaks for docker
- Remove `$` interpolation for env - Allow puppeteer to work headless in docker, headful with npx
This commit is contained in:
parent
308b71c698
commit
c64f8de15f
2 changed files with 72 additions and 59 deletions
|
|
@ -72,7 +72,7 @@ Here's the Claude Desktop configuration to use the Puppeter server:
|
|||
"mcpServers": {
|
||||
"puppeteer": {
|
||||
"command": "docker",
|
||||
"args": ["run", "-i", "--rm", "--init", "ai/mcp-puppeteer"]
|
||||
"args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "ai/mcp-puppeteer"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,9 @@ const screenshots = new Map<string, string>();
|
|||
|
||||
async function ensureBrowser() {
|
||||
if (!browser) {
|
||||
browser = await puppeteer.launch({ headless: true, args: ["--no-sandbox"] });
|
||||
const npx_args = { headless: false }
|
||||
const docker_args = { headless: true, args: ["--no-sandbox", "--single-process", "--no-zygote"] }
|
||||
browser = await puppeteer.launch(process.env.DOCKER_CONTAINER ? docker_args : npx_args);
|
||||
const pages = await browser.pages();
|
||||
page = pages[0];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue