From ce0b822b6366a715fee9100e3dfaeccb3644e248 Mon Sep 17 00:00:00 2001 From: D8D Developer Date: Fri, 20 Mar 2026 12:08:01 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=20Spot=20=E6=8A=A2?= =?UTF-8?q?=E5=8D=A0=E5=BC=8F=E5=AE=9E=E4=BE=8B=E6=B3=A8=E8=A7=A3=E5=92=8C?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E6=B3=A8=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 eci-spot-instance 注解启用抢占式实例 - 从 .env 读取 ANTHROPIC_BASE_URL 并注入容器环境变量 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- scripts/deploy.ts | 6 ++++++ src/deploy.ts | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 2693cf8..6a30b17 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -146,12 +146,18 @@ async function main() { console.log(` 端口: ${options.port}`); console.log(` EIP 带宽: ${options.eipBandwidth} Mbps`); + // 构建环境变量 - 从当前 .env 读取关键配置注入容器 + const containerEnv: Record = { + ANTHROPIC_BASE_URL: process.env.ANTHROPIC_BASE_URL || 'https://api.anthropic.com', + }; + const result = await deployProxy({ name, image, replicas: options.replicas, port: options.port, eipBandwidth: options.eipBandwidth, + env: containerEnv, }); if (result.success) { diff --git a/src/deploy.ts b/src/deploy.ts index 0c44a73..b51db1d 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -91,6 +91,8 @@ export async function deployProxy(params: DeployProxyParams): Promise