| FROM python:3.11-slim |
|
|
| LABEL maintainer="Hermes Agent Community" |
| LABEL version="0.10.0" |
| LABEL description="Hermes Agent v0.10.0 with Web UI on Hugging Face Spaces" |
|
|
| |
| ENV PYTHONUNBUFFERED=1 |
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV HERMES_HOME=/data/.hermes |
| ENV PYTHONPATH=/app |
|
|
| |
| ENV PORT=7860 |
| ENV UPSTREAM=http://127.0.0.1:8642 |
| ENV HERMES_BIN=/usr/local/bin/hermes |
| |
| |
| |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| ffmpeg \ |
| git \ |
| curl \ |
| unzip \ |
| ca-certificates \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| |
| RUN ARCH=$(dpkg --print-architecture) \ |
| && if [ "$ARCH" = "amd64" ]; then NODE_ARCH="x64"; else NODE_ARCH="$ARCH"; fi \ |
| && echo "Installing Node.js v23.11.0 for ${NODE_ARCH}" \ |
| && curl -fsSL "https://nodejs.org/dist/v23.11.0/node-v23.11.0-linux-${NODE_ARCH}.tar.gz" \ |
| -o /tmp/node.tar.gz \ |
| && tar -xzf /tmp/node.tar.gz -C /usr/local --strip-components=1 \ |
| && rm -f /tmp/node.tar.gz \ |
| && node --version \ |
| && npm --version |
|
|
| |
| |
| |
| RUN echo "Installing Bun runtime" \ |
| && curl -fsSL https://bun.sh/install | bash \ |
| && export PATH="$PATH:/root/.bun/bin" \ |
| && bun --version \ |
| && cp /root/.bun/bin/bun /usr/local/bin/bun \ |
| && chmod +x /usr/local/bin/bun |
|
|
| |
| |
|
|
| |
| |
| |
| |
| RUN mkdir -p /home/appuser/.baoyu-skills/baoyu-imagine && \ |
| git clone --depth 1 https://github.com/JimLiu/baoyu-skills.git /tmp/baoyu-skills && \ |
| cp -r /tmp/baoyu-skills/skills/baoyu-image-gen/scripts \ |
| /home/appuser/.baoyu-skills/baoyu-imagine/scripts && \ |
| rm -rf /tmp/baoyu-skills |
|
|
| |
| |
| RUN curl -sL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && \ |
| chmod +x /usr/bin/yq |
|
|
| |
| COPY requirements.txt /tmp/ |
| RUN pip install --no-cache-dir -r /tmp/requirements.txt |
|
|
| |
| |
| RUN git clone --depth 1 https://github.com/NousResearch/hermes-agent.git /tmp/hermes-agent && \ |
| pip install --no-cache-dir /tmp/hermes-agent[all] && \ |
| mkdir -p /data/.hermes &&\ |
| cp -r /tmp/hermes-agent /data/.hermes/hermes-agent &&\ |
| rm -rf /tmp/hermes-agent /root/.cache/pip |
|
|
| |
| RUN npx playwright install chromium --with-deps --only-shell |
|
|
| |
| |
| RUN git clone --depth 1 https://github.com/EKKOLearnAI/hermes-web-ui.git /tmp/hermes-web-ui && \ |
| cd /tmp/hermes-web-ui && \ |
| npm pkg delete scripts.prepare && \ |
| npm install && \ |
| npm run build && \ |
| npm prune --omit=dev && \ |
| mkdir -p /opt/hermes-web-ui && \ |
| cp -r dist node_modules package.json /opt/hermes-web-ui/ && \ |
| rm -rf /tmp/hermes-web-ui /root/.npm |
|
|
| |
| |
| RUN printf "import os, glob\n\ |
| dist = '/opt/hermes-web-ui/dist'\n\ |
| replacements = {\n\ |
| '默认登录名:admin,默认密码:123456': '',\n\ |
| 'Default credentials: admin / 123456': '',\n\ |
| 'Default login name: admin, default password: 123456': '',\n\ |
| }\n\ |
| modified = 0\n\ |
| for f in glob.glob(f'{dist}/**/*.js', recursive=True):\n\ |
| try:\n\ |
| with open(f, 'r', encoding='utf-8') as fp:\n\ |
| content = fp.read()\n\ |
| changed = False\n\ |
| for old, new in replacements.items():\n\ |
| if old in content:\n\ |
| content = content.replace(old, new)\n\ |
| changed = True\n\ |
| if changed:\n\ |
| with open(f, 'w', encoding='utf-8') as fp:\n\ |
| fp.write(content)\n\ |
| modified += 1\n\ |
| except Exception:\n\ |
| pass\n\ |
| print(f'Login hint patched in {modified} files')\n" > /tmp/patch_login.py && python3 /tmp/patch_login.py && rm /tmp/patch_login.py |
|
|
| |
| WORKDIR /app |
|
|
| COPY src/ /app/src/ |
| COPY entrypoint.sh /app/ |
| COPY image-proxy.js /app/ |
| COPY image-gen-siliconflow.ts /app/ |
| COPY config/config.yaml /data/.hermes/config.yaml |
|
|
| |
| RUN mkdir -p /data/.hermes /data/.hermes-web-ui /app/logs /home/appuser/.hermes-web-ui/logs && \ |
| chmod +x /app/entrypoint.sh |
|
|
| |
| RUN useradd -m -u 1000 appuser && \ |
| ln -sf /data/.hermes /home/appuser/.hermes && \ |
| mkdir -p /home/appuser/.cache && \ |
| chown -R appuser:appuser /data /opt/hermes-web-ui /app /home/appuser |
|
|
| USER appuser |
|
|
| |
| |
| |
| ENV NODE_ENV=production |
|
|
| |
| |
| EXPOSE 7860 |
|
|
| HEALTHCHECK --interval=30s --timeout=10s --start-period=90s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| ENTRYPOINT ["/app/entrypoint.sh"] |
|
|