Spaces:
Paused
Paused
| FROM python:3.11-slim | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # 安装系统依赖 | |
| RUN apt-get update && apt-get install -y \ | |
| git git-lfs rsync curl bash build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 配置 Git LFS 和基础信息 | |
| RUN git lfs install && \ | |
| git config --global user.email "hermes@space.hf" && \ | |
| git config --global user.name "Shuyun18" | |
| # ================= 安装 Hermes Agent ================= | |
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh | |
| ENV PATH="/root/.local/bin:${PATH}" | |
| # 克隆并安装 Hermes | |
| RUN git clone https://github.com/NousResearch/hermes-agent.git /opt/hermes-agent | |
| WORKDIR /opt/hermes-agent | |
| RUN uv venv venv --python 3.11 && \ | |
| . venv/bin/activate && \ | |
| uv pip install -e ".[all]" | |
| # 将 hermes 命令链接到全局 | |
| RUN ln -sf /opt/hermes-agent/venv/bin/hermes /usr/local/bin/hermes | |
| # ================= 安装 Hermes HUDUI ================= | |
| RUN python -m venv /opt/hermes-hudui-venv | |
| RUN /opt/hermes-hudui-venv/bin/pip install --upgrade pip && \ | |
| /opt/hermes-hudui-venv/bin/pip install git+https://github.com/joeynyc/hermes-hudui | |
| # 准备数据和配置目录 | |
| RUN mkdir -p /root/.hermes /root/.hermes-hudui/data | |
| # 复制启动与同步脚本 | |
| COPY sync_data.sh /sync_data.sh | |
| COPY start.sh /start.sh | |
| RUN chmod +x /sync_data.sh /start.sh | |
| # 暴露 HF Space 要求的 7860 端口 | |
| EXPOSE 7860 | |
| WORKDIR /root | |
| # 使用启动脚本作为入口 | |
| CMD ["/start.sh"] |