feat: 将 Agent 接入运行时镜像挂载式部署

This commit is contained in:
2026-09-20 17:34:25 +08:00
parent 5393ad3423
commit 67c2d58c32
20 changed files with 499 additions and 40 deletions
+14
View File
@@ -0,0 +1,14 @@
# 运行时镜像:业务代码与依赖通过 volume 挂载 /app,更新部署无需重建镜像
ARG BASE_IMAGE=docker.m.daocloud.io/library/python:3.12-slim
FROM ${BASE_IMAGE}
WORKDIR /app
RUN groupadd --system app && useradd --system --gid app --home-dir /app app
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
USER app
# 实际端口由环境 PORT 决定(test:8201 / pre:8202 / prod:8203)
EXPOSE 8201 8202 8203
ENTRYPOINT ["/entrypoint.sh"]
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
# 使用镜像内 Python 加载挂载的源码与 .deps(避免 venv shebang 路径不可移植)
set -e
export PYTHONPATH="/app:/app/.deps${PYTHONPATH:+:$PYTHONPATH}"
exec python -m uvicorn api.main:app --host 0.0.0.0 --port "${PORT:-8201}"