File size: 2,535 Bytes
287d491
4136906
9cb5fe7
 
 
 
 
 
4136906
 
 
 
 
 
 
 
9cb5fe7
287d491
 
 
 
4136906
 
 
 
 
 
 
 
287d491
 
4136906
287d491
4136906
9cb5fe7
 
 
 
 
 
 
 
 
3cb49fd
 
 
 
 
 
 
 
 
 
9cb5fe7
 
 
 
 
4136906
287d491
4136906
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Persistent Hermes Agent (Nous Research) on a Hugging Face Space.
# Connected to OpenRouter with subagent spawning (delegate_task / orchestration).
#
# Layout:
#   - Runtime (hermes venv + launcher) baked INTO the image at build time.
#   - HERMES data (~/.hermes: config, .env, memories, skills, sessions, cron)
#     lives on the /data volume (private bucket) → persistent across restarts.
#   - Entrypoint swaps ~/.hermes → /data and seeds the volume on first boot.

FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive \
    LANG=C.UTF-8 \
    LC_ALL=C.UTF-8 \
    HOME=/root

# System prerequisites + enable 'universe' so ripgrep / ffmpeg are available.
RUN . /etc/os-release \
    && printf 'deb http://archive.ubuntu.com/ubuntu %s universe\ndeb http://archive.ubuntu.com/ubuntu %s-updates universe\n' "$VERSION_CODENAME" "$VERSION_CODENAME" >> /etc/apt/sources.list \
    && apt-get update \
    && apt-get install -y --no-install-recommends \
        git \
        curl \
        ca-certificates \
        build-essential \
        pkg-config \
        libssl-dev \
        libffi-dev \
        python3-dev \
        ripgrep \
        ffmpeg \
        tzdata \
    && rm -rf /var/lib/apt/lists/*

# Install Hermes Agent at BUILD time (root FHS layout):
#   code+venv   -> /usr/local/lib/hermes-agent
#   launcher    -> /usr/local/bin/hermes
#   node/uv/etc -> /root/.hermes  (moved to a seed dir below)
RUN curl -fsSL https://hermes-agent.nousresearch.com/install.sh \
        | bash -s -- \
            --non-interactive \
            --skip-setup

# Pre-build the web dashboard UI so the runtime never needs npm (--skip-build).
# The installer keeps its managed Node under ~/.hermes/node/bin.
# Only runs if the package shipped a `web/` source dir (dev installs may skip it).
RUN if [ -d /usr/local/lib/hermes-agent/web ]; then \
        export PATH="/root/.hermes/node/bin:$PATH"; \
        cd /usr/local/lib/hermes-agent/web \
        && npm install --no-audit --no-fund \
        && npm run build; \
    fi

# Preserve the build-time ~/.hermes (managed node, uv, bundled skills) as a seed
# the runtime entrypoint copies into the persistent volume on first boot.
RUN rm -rf /hermes-seed && mkdir -p /hermes-seed \
    && mv /root/.hermes/* /hermes-seed/ 2>/dev/null || true \
    && ls -la /hermes-seed | head -40

ENV PATH=/usr/local/bin:/usr/bin:/bin

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

WORKDIR /root

EXPOSE 7860

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]