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: