mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
SANDBOX_PORTS env var (#204)
This commit is contained in:
parent
57ceadb7d8
commit
cd1ddcb4f1
2 changed files with 25 additions and 3 deletions
|
|
@ -203,6 +203,16 @@ async function start_sandbox(sandbox: string) {
|
|||
nodeArgs.push(`--inspect-brk=0.0.0.0:${debugPort}`);
|
||||
}
|
||||
|
||||
// open additional ports if SANDBOX_PORTS is set
|
||||
if (process.env.SANDBOX_PORTS) {
|
||||
for (let port of process.env.SANDBOX_PORTS.split(',')) {
|
||||
if ((port = port.trim())) {
|
||||
console.log(`SANDBOX_PORTS: ${port}`);
|
||||
args.push('-p', `${port}:${port}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// append remaining args (image, node, node args, cli path, cli args)
|
||||
args.push(image, 'node', ...nodeArgs, cliPath, ...process.argv.slice(2));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue