Upstream Dockerfile sets `ENTRYPOINT [ "node", "./dist/index.js" ]`,
which boots the daemon directly and silently bypasses `scripts/start.js`
— the only place that runs `prisma migrate deploy`. On a clean install,
the SQLite db file at $DATABASE_URL is created empty (0 bytes) and
every Policy / KeyUser / Token / SigningCondition operation throws
"table does not exist." `ping` / `get_keys` / `create_new_key` happen
to survive because they only touch the JSON config, not the db.
Two changes:
1. ENTRYPOINT switches to `node ./scripts/start.js`. The CMD arg
(`start`) and any additional argv pass through to the daemon
unchanged via process.argv.
2. Runtime pnpm install drops `--prod`. The prisma CLI lives in
devDependencies; with `--prod`, `npx prisma migrate deploy` tries to
download prisma@latest at runtime, which OOMs in modest containers.
Including devDeps at runtime adds modest image bulk for correctness.
Validated end-to-end against the local regtest stack — after the
rebuild the SQLite db boots populated with 22 migrations, and the
lnbits-side admin spike harness passes all 9 steps including NIP-46
sign_event with Schnorr-valid signatures.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two upstream-rot issues fixed in one commit (same root cause: the
upstream Dockerfile predates the move to pnpm and the lockfile has
drifted):
- npm install can't resolve workspace:* deps (which package.json used
to declare for @nostr-dev-kit/ndk — see prior commit for the pin).
Switching to pnpm@9 matches the lockfile that ships in-repo.
- pnpm-lock.yaml is out of date vs package.json (likely from
generation-time vs commit-time drift), so --frozen-lockfile fails
with ERR_PNPM_OUTDATED_LOCKFILE. Drop the flag in both build and
runtime stages to let pnpm resolve fresh, at the cost of giving up
determinism — to be restored once the lockfile is regenerated.
Also reorders the build stage to COPY lockfile + manifest before the
source, so the install layer caches across source-only edits.
Fixes#1, #2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add .dockerignore
- Replace .env with .env.example
- Add migrations service
- Cleanup Dockerfile: simpler setup, simpler copy, no migrations inside the image
- Update README to match new instruction
Removing "--platform=" and slightly re-structuring the "apt-get" calls allows for this image to be successfuly built for arm64 as well - at least on an arm64 host.