From fd71fc4063ac632fd158145a98759d570526dfe2 Mon Sep 17 00:00:00 2001 From: starrrLight Date: Tue, 13 Oct 2026 16:39:54 +0800 Subject: [PATCH] =?UTF-8?q?chore(=E9=83=A8=E7=BD=B2):=20=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E7=8E=B0=E6=9C=89=E6=A8=A1=E5=9E=8B=E9=95=9C=E5=83=8F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 默认镜像安装 guard 依赖并启用离线模式,移除独立模型 Dockerfile,保留现有配置调整。 --- Dockerfile | 6 +++++- Dockerfile.guard | 11 ----------- config.yaml | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 Dockerfile.guard diff --git a/Dockerfile b/Dockerfile index fd70aed..6df9d27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,13 @@ FROM python:3.14-slim WORKDIR /service COPY pyproject.toml ./ COPY middleware ./middleware -RUN pip install --no-cache-dir . +RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple \ + --trusted-host pypi.tuna.tsinghua.edu.cn \ + --default-timeout=60 --no-cache-dir \ + ".[guard]" COPY config.yaml ./ COPY plugins ./plugins +ENV HF_HUB_OFFLINE=1 USER 65532:65532 EXPOSE 8080 CMD ["agent-safe-middleware", "--config", "/service/config.yaml"] diff --git a/Dockerfile.guard b/Dockerfile.guard deleted file mode 100644 index 25cd671..0000000 --- a/Dockerfile.guard +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:3.13-slim -WORKDIR /service -COPY pyproject.toml ./ -COPY middleware ./middleware -RUN pip install --no-cache-dir ".[guard]" -COPY config.yaml ./ -COPY plugins ./plugins -ENV HF_HUB_OFFLINE=1 -USER 65532:65532 -EXPOSE 8080 -CMD ["agent-safe-middleware", "--config", "/service/config.yaml"] diff --git a/config.yaml b/config.yaml index 966b658..2bc1de1 100644 --- a/config.yaml +++ b/config.yaml @@ -4,7 +4,7 @@ listen_port: 8080 limits: max_sessions: 4 - hook_timeout_seconds: 60 # guard 模型 CPU 推理慢,默认 5s 不够 + hook_timeout_seconds: 60 upstream_timeout_seconds: 120 llm: