diff --git a/mcp-server-demo/Dockerfile b/mcp-server-demo/Dockerfile index 4fa16db..4da62ee 100644 --- a/mcp-server-demo/Dockerfile +++ b/mcp-server-demo/Dockerfile @@ -2,14 +2,20 @@ FROM python:3.12-slim WORKDIR /app +# 国内服务器访问 Debian / PyPI 官方源易超时,改用阿里云镜像 +RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources \ + || sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list + RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* COPY pyproject.toml ./ COPY excel_analyzer.py server.py ./ -RUN pip install --no-cache-dir --upgrade pip \ - && pip install --no-cache-dir --timeout 120 --retries 10 . +ENV PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ +ENV PIP_TRUSTED_HOST=mirrors.aliyun.com + +RUN pip install --no-cache-dir --timeout 300 --retries 10 . ENV MCP_HOST=0.0.0.0 ENV MCP_PORT=8010