biopython / Dockerfile
guohanghui's picture
Update Dockerfile
a74ade1 verified
Raw
History Blame Contribute Delete
822 Bytes
FROM python:3.10
# 安装编译依赖
RUN apt-get update && apt-get install -y \
gcc \
g++ \
make \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user && \
python -m pip install --upgrade pip
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /app
# ✅ 编译 Biopython 源码(生成 C 扩展)
RUN cd /app/biopython/source && \
python setup.py build_ext --inplace && \
cd /app
# ✅ 现在可以安全地设置 PYTHONPATH
ENV PYTHONPATH=/app/biopython/source:$PYTHONPATH
EXPOSE 7860
ENV MCP_TRANSPORT=http
ENV MCP_PORT=7860
# ✅ 修正:使用正确的路径
WORKDIR /app/biopython/mcp_output
CMD ["python", "start_mcp.py"]