agenticverse/AgentNexa
0
1# HermesFace on Hugging Face Spaces — Source build2# Builds Hermes Agent from source since no pre-built Docker image is published3# Rebuild 2026-04-13: initial release4 5# ── Stage 1: Build Hermes Agent from source ──────────────────────────────6FROM ghcr.io/astral-sh/uv:0.11.6-python3.13-trixie AS uv_source7FROM tianon/gosu:1.19-trixie AS gosu_source8 9FROM debian:13.410SHELL ["/bin/bash", "-c"]11 12ENV PYTHONUNBUFFERED=113ENV PLAYWRIGHT_BROWSERS_PATH=/opt/hermes/.playwright14 15# ── System dependencies ──────────────────────────────────────────────────16RUN echo "[build] Installing system deps..." && START=$(date +%s) \17 && apt-get update \18 && apt-get install -y --no-install-recommends \19 build-essential nodejs npm python3 python3-pip python3-venv \20 ripgrep ffmpeg gcc python3-dev libffi-dev procps \21 git ca-certificates curl \22 && rm -rf /var/lib/apt/lists/* \23 && pip3 install --no-cache-dir --break-system-packages huggingface_hub requests pyyaml \24 && echo "[build] System deps: $(($(date +%s) - START))s"25 26# ── Non-root user ────────────────────────────────────────────────────────27RUN useradd -u 10000 -m -d /opt/data hermes28 29COPY --chmod=0755 --from=gosu_source /gosu /usr/local/bin/30COPY --chmod=0755 --from=uv_source /usr/local/bin/uv /usr/local/bin/uvx /usr/local/bin/31 32# ── Clone and build Hermes Agent ─────────────────────────────────────────33RUN echo "[build] Cloning Hermes Agent..." && START=$(date +%s) \34 && git clone --depth 1 https://github.com/NousResearch/hermes-agent.git /opt/hermes \35 && echo "[build] Clone: $(($(date +%s) - START))s"36 37WORKDIR /opt/hermes38 39# ── Node dependencies + Playwright + Web Dashboard build ─────────────────40RUN echo "[build] Installing Node deps + Playwright..." && START=$(date +%s) \41 && npm install --prefer-offline --no-audit \42 && npx playwright install --with-deps chromium --only-shell \43 && if [ -d /opt/hermes/scripts/whatsapp-bridge ]; then \44 cd /opt/hermes/scripts/whatsapp-bridge && npm install --prefer-offline --no-audit; \45 fi \46 && echo "[build] Building web dashboard..." \47 && cd /opt/hermes/web && npm install --prefer-offline --no-audit && npm run build \48 && cd /opt/hermes && npm cache clean --force \49 && echo "[build] Node deps + web dashboard: $(($(date +%s) - START))s"50 51# ── Python dependencies ──────────────────────────────────────────────────52RUN chown -R hermes:hermes /opt/hermes53USER hermes54 55RUN echo "[build] Installing Python deps..." && START=$(date +%s) \56 && cd /opt/hermes \57 && uv venv \58 && uv pip install --no-cache-dir -e ".[all]" \59 && uv pip install --no-cache-dir "python-telegram-bot[webhooks]==22.6" \60 && uv pip install --no-cache-dir huggingface_hub requests pyyaml \61 && echo "[build] Python deps: $(($(date +%s) - START))s"62 63USER root64RUN chmod +x /opt/hermes/docker/entrypoint.sh65 66# ── Prepare runtime dirs ────────────────────────────────────────────────67RUN mkdir -p /opt/data/cron /opt/data/sessions /opt/data/logs /opt/data/hooks \68 /opt/data/memories /opt/data/skills /opt/data/skins /opt/data/plans \69 /opt/data/workspace /opt/data/home \70 && chown -R hermes:hermes /opt/data71 72USER hermes73 74# ── HermesFace scripts (persistence + entrypoint + DNS + assets) ──────75ARG CACHE_BUST=2026-04-22-v276RUN echo "Build: ${CACHE_BUST}"77COPY --chown=hermes:hermes scripts /opt/data/scripts78COPY --chown=hermes:hermes assets /opt/data/assets79RUN chmod +x /opt/data/scripts/entrypoint.sh \80 /opt/data/scripts/dns-resolve.py \81 /opt/data/scripts/hermes_persist.py \82 /opt/data/scripts/save_to_dataset.py \83 /opt/data/scripts/save_to_dataset_atomic.py \84 /opt/data/scripts/restore_from_dataset.py \85 /opt/data/scripts/restore_from_dataset_atomic.py86 87ENV HERMES_HOME=/opt/data88ENV PATH="/opt/hermes/.venv/bin:$PATH"89WORKDIR /opt/data90 91CMD ["/opt/data/scripts/entrypoint.sh"]92 