主要更新: - 新增 external_tool_api.py: 外部工具管理 API - 新增 tool_storage.py: 工具存储管理器 - 新增回调功能用于计费 (agent_callback_utils) - 支持多工具创建 Agent - 新增 CI/CD 构建状态查询 API - 新增部署信息查询 API - 更新文档 (EXTERNAL_TOOL_API.md v2.0) - 更新 Dockerfile 添加新模块 - 更新 app.py 集成外部工具路由
40 lines
815 B
Docker
40 lines
815 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# 安装系统依赖
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# 复制应用代码
|
|
COPY requirements.txt .
|
|
COPY app.py .
|
|
COPY k8s_manager.py .
|
|
COPY database.py .
|
|
COPY template_manager.py .
|
|
COPY gitee_manager.py .
|
|
COPY agent_code_generator.py .
|
|
COPY tool_generator_api.py .
|
|
COPY external_tool_api.py .
|
|
COPY tool_storage.py .
|
|
COPY agent_manager/ ./agent_manager/
|
|
|
|
# 创建工具存储目录
|
|
RUN mkdir -p /app/tool_storage
|
|
|
|
# 安装依赖
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# 设置环境变量
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV NAMESPACE=ai-agents
|
|
ENV SERVICE_PORT=8000
|
|
ENV SERVICE_HOST=0.0.0.0
|
|
|
|
# 暴露端口
|
|
EXPOSE 8000
|
|
|
|
# 运行应用
|
|
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|