后端docker 部署文件大改

This commit is contained in:
BBIT-Kai
2025-11-05 18:08:28 +08:00
parent 3d46cef3bd
commit 5a73018582
10 changed files with 143 additions and 49 deletions
+29
View File
@@ -0,0 +1,29 @@
# 第一阶段:构建Python依赖
FROM python:3.10-slim as builder
# 设置工作目录
WORKDIR /app
# 复制依赖文件
COPY app_mcp/requirements.txt .
# 安装Python依赖
RUN pip install --no-cache-dir -r requirements.txt
# 第二阶段:运行阶段
FROM python:3.10-slim
# 设置工作目录
WORKDIR /app
# 从构建阶段复制Python依赖
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
# 创建必要的目录
RUN mkdir -p logs data
# 复制应用代码
COPY app_mcp/ .
# 启动命令
CMD ["python", "app.py"]