File size: 1,141 Bytes
e9f71ff
cf234f3
e9f71ff
 
 
 
 
 
 
cf234f3
 
e9f71ff
5093482
 
 
 
 
e9f71ff
bba69c3
 
e9f71ff
 
bba69c3
 
e9f71ff
 
bba69c3
 
e9f71ff
bba69c3
e9f71ff
 
bba69c3
 
e9f71ff
bba69c3
e9f71ff
 
bba69c3
e9f71ff
 
bba69c3
e9f71ff
 
bba69c3
 
e9f71ff
 
 
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
FROM python:3.11-slim

# 安装必要的系统依赖(构建 Python 包用)
RUN apt-get update && apt-get install -y \
    build-essential \
    python3-dev \
    && rm -rf /var/lib/apt/lists/*

# 查看 Python 和 pip 版本
RUN python --version
RUN pip --version

# 安装 Git 和其他必要的系统依赖
RUN apt-get update && apt-get install -y \
    git \
    && rm -rf /var/lib/apt/lists/*

# 创建普通用户并升级 pip
RUN useradd -m -u 1000 user && \
    python -m pip install --upgrade pip

# 切换到普通用户
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# 设置工作目录
WORKDIR /app

# 复制 requirements.txt 并安装依赖
COPY --chown=user ./requirements.txt requirements.txt

# 对于 CPU-only 环境,确保 requirements.txt 中的 cupy 改为 cupy-cuda-none 或去掉 cupy
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# 复制代码
COPY --chown=user . /app

# 设置 PYTHONPATH
ENV PYTHONPATH=/app/TenCirChem/source:$PYTHONPATH

# 暴露端口
EXPOSE 7860

# MCP 配置
ENV MCP_TRANSPORT=http
ENV MCP_PORT=7860

# 启动命令
CMD ["python", "TenCirChem/mcp_output/start_mcp.py"]