-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (46 loc) · 1.69 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (46 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# ============================================================
# DocReview Agent System — Docker 镜像
# 基于 python:3.11-slim,包含 Node.js(MCP 服务依赖)
# ============================================================
FROM python:3.13-slim
# 避免交互式安装提示
ENV DEBIAN_FRONTEND=noninteractive
# ---- 系统依赖 + Node.js ----
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
gnupg \
build-essential \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# ---- 工作目录 ----
WORKDIR /app
# ---- 复制全部项目文件 ----
COPY pyproject.toml README.md main.py mcp_server_start.py mcp_stdio_start.py ./
COPY src/ src/
COPY prompts/ prompts/
COPY specs/ specs/
COPY docs/ docs/
COPY examples/ examples/
COPY tests/ tests/
# ---- 安装 Python 依赖(含开发/测试依赖) ----
RUN pip install --no-cache-dir ".[dev]"
# ---- 创建运行时目录 ----
RUN mkdir -p logs data reviews workspace
# ---- 创建非 root 用户 ----
RUN groupadd -r docreview && useradd -r -g docreview -d /app docreview \
&& chown -R docreview:docreview /app
USER docreview
# ---- 环境变量默认值 ----
ENV PYTHONUNBUFFERED=1 \
LOG_LEVEL=INFO \
WORKSPACE_DIR=/app/workspace
# ---- 暴露 HTTP MCP Server 端口 ----
EXPOSE 8000
# ---- 健康检查 ----
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# ---- 默认启动 HTTP MCP Server ----
CMD ["python", "mcp_server_start.py", "--host", "0.0.0.0", "--port", "8000"]