fix(docker): auto-init on empty /data so first Render deploy can boot#5
Conversation
A fresh Render Blueprint deploy provisions an empty 1 GiB disk at /data, so the server entrypoint hit `read config: open hooks.yaml: no such file` and crash-looped. The documented "Shell in and run `hooks init`" recovery path is unreachable on first deploy because Render's Shell tab requires a running instance. Add docker-entrypoint.sh that runs `hooks init --dir /data` exactly when both hooks.yaml and hooks.db are absent, then exec's the binary. Explicit subcommands (init/invite/prune/verify/help) bypass the bootstrap. The admin token + bootstrap signup URL print to the service log on first boot — same place they'd land if run from Shell. Update docs/quickstart.md section 3b to reflect the new flow, and add TestImageFirstBootAutoInit covering the empty-/data path end-to-end.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…n gate Sonar flagged 17.9% duplication on new code: TestImageFirstBootAutoInit and TestImageServesHealthEndpoints share the same docker-run + cleanup + hostPort envelope. Lift it into runImageDetached and call from both.
|



Summary
/datadisk has nohooks.yaml, and Render's Shell tab is gated on a running instance — so the documentedhooks initrecovery is unreachable.docker-entrypoint.shrunshooks init --dir /dataonly when bothhooks.yamlandhooks.dbare absent, thenexecs the binary. The admin token + bootstrap signup URL print to the service log on first boot.init,invite,prune,verify,help,-h,--help) bypass the auto-init sodocker run hooks prune ...etc. still pass through unchanged.docs/quickstart.md3b and addedTestImageFirstBootAutoInitcovering the empty-/datapath end-to-end.Test plan
make lint— 0 issuesmake test— all unit suites passgo test -tags docker ./dockertest/ -count=1— 10 PASS, 1 expected SKIP (UID-translating Docker Desktop)TestImageFirstBootAutoInit(new) confirms: empty/data→ server reaches/healthz200 →hooks.yamlandhooks.dbmaterialize → admin token line printedTestImageInitFailsClearlyOn0o755HostDirstill skips/passes — explicitinitsubcommand still goes through unchanged