No description
- Dockerfile 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .env.example | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| README.md | ||
Paperclip on unicorn-machine
Paperclip running on unicorn-machine (Windows + Docker Desktop), migrated from the
instance that ran on bridge.
- UI/API: https://paperclip.kuster.live (proxied) and http://localhost:3110 (direct)
- Database: PostgreSQL 17, docker volume
paperclip-unicorn_pgdata - Paperclip home: docker volume
paperclip-unicorn_paperclip-data - Image:
paperclip-unicorn:local, built fromDockerfile
Run
docker compose up -d --build
docker compose logs -f
docker compose down # stop, keep data
docker compose down -v # stop and delete data
Migration from bridge (already done)
The .migration/ directory in this repo is the export taken from bridge
(Unraid Compose Manager project paperclip):
.migration/
├── compose/ the bridge's compose project + .env (its secrets)
└── appdata/
├── pgdata/ PostgreSQL 17 data directory (the real database)
└── paperclip-data/ the bridge's /paperclip volume (workspaces, secrets, logs)
It was restored as a physical restore, not a logical one:
| Piece | How it was restored |
|---|---|
appdata/pgdata |
Copied into the pgdata volume as-is (cp -a, chown postgres, chmod 700). Postgres 17.9 opens it directly — no dump needed. |
appdata/paperclip-data |
Copied into the paperclip-data volume, minus instances/default/data/backups (2.5 GB of superseded dumps; the instance makes its own). |
secrets/master.key |
Copied with the home volume. Required — the 10 company secret values are encrypted with it and cannot be recovered without it. |
secrets/decision-signing.key |
Copied with the home volume, so decision signatures still verify. |
BETTER_AUTH_SECRET |
Reused from the bridge's .env, so existing sessions stay valid. |
PAPERCLIP_TOOL_ACTION_SIGNING_SECRET |
Reused from the bridge's .env, so pending approvals still verify. |
POSTGRES_PASSWORD |
Rotated to a fresh local secret. The bridge's password was not reused. |
After the restore the server applied the 118 pending migrations (332 → 450) on its first start. All data came across: 1 company, 4 agents, 78 issues, 10 projects, 3061 activity-log rows, 1 user, 10 company secrets.
Redo the restore from scratch
docker compose down -v
# 1. Seed the database volume from the exported data directory
docker volume create paperclip-unicorn_pgdata
docker run --rm -v paperclip-unicorn_pgdata:/dst \
-v "$PWD/.migration/appdata/pgdata:/src:ro" postgres:17-alpine \
sh -c "cp -a /src/. /dst/ && chown -R postgres:postgres /dst && chmod 700 /dst"
# 2. Seed the Paperclip home volume
docker volume create paperclip-unicorn_paperclip-data
docker run --rm -v paperclip-unicorn_paperclip-data:/dst \
-v "$PWD/.migration/appdata/paperclip-data:/src:ro" alpine:3 \
sh -c "mkdir -p /dst && (cd /src && tar cf - --exclude=instances/default/data/backups .) | (cd /dst && tar xf -) && chown -R 1000:1000 /dst && chmod 700 /dst/instances/default/secrets && chmod 600 /dst/instances/default/secrets/*"
# 3. Start Postgres, then rotate the role password over its local (trusted) socket
docker compose up -d db
docker compose exec db psql -U paperclip -d paperclip -c "ALTER ROLE paperclip WITH PASSWORD '<new>';"
# then put the same value in .env as POSTGRES_PASSWORD
# 4. Start the server (migrations apply automatically)
docker compose up -d server
Notes
- The derived image is not optional.
Dockerfilefixes two upstream problems:- The published image ships a 0-byte
/usr/local/bin/docker-entrypoint.sh, so its ownENTRYPOINTexits 0 immediately and the container restart-loops. The intact script is at/app/scripts/docker-entrypoint.sh; the Dockerfile copies it over. - The agent CLIs baked into the image (claude, codex, opencode, gemini) are
Bun-compiled binaries from 2026-11-16 that SIGBUS on this host's kernel — even
outside Docker, in plain WSL2. The Dockerfile reinstalls them from npm, which
produces working binaries. Verified:
opencode --version→1.19.6.
- The published image ships a 0-byte
PAPERCLIP_PUBLIC_URLishttps://paperclip.kuster.live. A reverse proxy forwards that hostname here, so it must be the canonical URL — the auth base URL, cookie origin and callback URLs derive from it, and the hostname guard allows only names inPAPERCLIP_ALLOWED_HOSTNAMES. Getting this wrong shows up as "This hostname is not allowed for this Paperclip instance".- The container's internal port equals the published port (3110). Paperclip derives
the
:portvariants of its allowed-hostname origins from the listen port, so a mismatch makes directhttp://localhost:3110access fail the origin check. - Named volumes, not bind mounts. The entrypoint chowns
/paperclipto the container user; over a Windows bind mount that is slow and fragile. - Agents are
opencode_localand resumed running against the restored workspaces. Run logs land inpaperclip-data/instances/default/data/run-logs/. - Secrets:
.envholdsPOSTGRES_PASSWORD,BETTER_AUTH_SECRETandPAPERCLIP_TOOL_ACTION_SIGNING_SECRET. It is gitignored. Never commit it. - The
opencode_localadapter needs its own provider credentials inside the container. They came across inpaperclip-data/.local/share/opencode/auth.json; re-connect via Apps → Connections if a run reports an auth error.