FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
COPY . /app/
RUN sed -i 's/ports.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
bash
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh; \
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh -O /tmp/miniconda.sh; \
else \
echo "不支持的架构: $ARCH"; exit 1; \
fi && \
bash /tmp/miniconda.sh -b -p /opt/conda && \
rm /tmp/miniconda.sh
ENV PATH="/opt/conda/bin:$PATH"
RUN conda init bash && \
echo "conda activate mcp-agent" >> ~/.bashrc
RUN apt-get install -y \
nodejs \
npm
RUN npm install -g n && \
n stable && \
hash -r
RUN npm config set registry https://registry.npmmirror.com
RUN npm install -g pnpm
RUN npm install -g @modelcontextprotocol/sdk
RUN npm install -g typescript ts-node
RUN pip3 install uv -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN conda create -n mcp-agent python=3.13 -y && \
echo 'conda activate mcp-agent' >> ~/.bashrc
SHELL ["/bin/bash", "-c"]
RUN source /opt/conda/bin/activate mcp-agent && \
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python-dotenv rich asyncio fastapi uvicorn docker httpx PyYAML motor gunicorn beanie psutil tenacity jinja2 json5 mcp openai jsonschema toml
RUN conda create -n mcp-executor python=3.10 -y
RUN mkdir -p /app/code_storage && \
mkdir -p /app/filesystem && \
mkdir -p /app/shared_input
RUN source /opt/conda/bin/activate mcp-agent && \
cd /app/mcp_servers/mcp_code_executor && \
npm install && \
npm run build
RUN npm install -g mcp-server-commands
RUN npm install -g @modelcontextprotocol/server-filesystem
RUN source /opt/conda/bin/activate mcp-agent && \
cd /app/mcp_servers/nlp-search-infra-server && \
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
RUN cp -r /app/data/GAIA /app/filesystem/ || echo "GAIA文件夹不存在,将在启动时检查"
ENV PYTHONPATH=/app:$PYTHONPATH
ENV CODE_STORAGE_DIR=/app/code_storage
ENV CONDA_ENV_NAME=mcp-executor
ENV UV_PATH=/usr/local/bin/uv
RUN mkdir -p /app/mcp_server_logs
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["docker-entrypoint.sh"]