feat: add custom Dockerfile with Hermes adapter baked in
Some checks failed
Build Hermes agent / build (pull_request) Has been cancelled
Build ollama (gfx906) / build (pull_request) Has been cancelled

Creates ai/paperclip/ with:
- Dockerfile: extends upstream paperclip image, pre-installs
  hermes-paperclip-adapter@0.3.0 npm package as seed data
- docker-entrypoint.sh: seeds the adapter plugin on first boot
  if the persistent volume is empty, then runs original startup

This ensures the Hermes adapter is available on first boot without
requiring network access — no npm install needed at runtime. The
adapter persists on the Docker volume across restarts.
This commit is contained in:
2026-05-18 18:37:31 -04:00
parent 563ccc5632
commit 37bf43c3ea
3 changed files with 84 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
#!/bin/sh
set -e
# ── Seed Hermes adapter if volume is fresh ──────────────────────────
PAPERCLIP_HOME="${PAPERCLIP_HOME:-/paperclip}"
if [ ! -f "${PAPERCLIP_HOME}/adapter-plugins.json" ]; then
echo "[paperclip] Seeding Hermes adapter plugin..."
cp -r /opt/paperclip-seed/* "${PAPERCLIP_HOME}/"
chown -R "${USER_UID:-1000}:${USER_GID:-1000}" \
"${PAPERCLIP_HOME}/adapter-plugins" \
"${PAPERCLIP_HOME}/adapter-plugins.json"
echo "[paperclip] Hermes adapter seeded. Ready to create Hermes agents."
fi
# ── Original entrypoint logic (UID/GID adjustment) ──────────────────
PUID="${USER_UID:-1000}"
PGID="${USER_GID:-1000}"
changed=0
if [ "$(id -u node)" -ne "$PUID" ]; then
usermod -o -u "$PUID" node
changed=1
fi
if [ "$(id -g node)" -ne "$PGID" ]; then
groupmod -o -g "$PGID" node
usermod -g "$PGID" node
changed=1
fi
if [ "$changed" = "1" ]; then
chown -R node:node "${PAPERCLIP_HOME}"
fi
exec gosu node "$@"