chore(docs): upgrade to docs-kit 1.0.3 — Thruster CMD + Docker image slimming - #33
Conversation
…slimming Switch the docs app from the GitHub ref (locked to pre-1.0 SHA 82d76a7, gemspec 0.1.0) to the released gem: gem "docs-kit", "~> 1.0.3". The GitHub source existed only because the sibling repo sat outside the Docker build context — obsolete now the gem is on RubyGems. Side effect: rouge is pinned back from 5.0.0 to 4.7.0 by docs-kit's `rouge (>= 4.0, < 5)` constraint. Thruster now fronts Puma in the container (compression, static-asset caching, X-Sendfile): added `gem "thruster", require: false`, the bin/thrust binstub (scaffolded by `docs_kit:install --sync`), and the port topology — Thruster listens on HTTP_PORT=3000 (Kamal app_port / EXPOSE / healthcheck unchanged) and proxies to Puma on TARGET_PORT=3001 (Thruster sets PORT for the child; config/puma.rb reads it). Thruster's default HTTP_PORT of 80 would neither bind as non-root nor be routed to by kamal-proxy. Build-stage prunes: rm -rf node_modules /usr/local/bun after assets:precompile, so the final stage's COPY of /gem no longer ships the ~103M of JS deps. tmp/cache is deliberately kept — it holds the bootsnap cache precompiled in the build stage. The bundle-install prune (bundler cache + git checkouts) was already present. Dockerignore: repo-root .dockerignore (the active one — build context is the repo root) gains coverage/, pkg/, tmp/, .bundle, .worktrees/, .rspec_status, docs/.rspec, docs/coverage. docs/.dockerignore is now the gem-owned standalone-flavor file force-written by --sync; inert here but kept as gem-owned. --sync also created lib/tasks/docs_kit_og.rake and refreshed the AGENTS.md docs-kit block (operation helper / OpenAPI docs). Verification: image builds from the repo root (554MB, node_modules-free — verified CLEAN in the final image); container boots with Thruster on :3000 and Puma "Listening on http://0.0.0.0:3001"; GET /up -> 200; a digested /assets/*.css served with Content-Encoding: gzip + X-Cache: miss (Puma alone never compresses — proves Thruster serves). Docs suite: 8 examples, 0 failures (bin/rspec; the suite is the request specs — spec/system contains only support files, no system specs exist). Part of the docs-kit 1.0.3 dogfood rollout. Claude-Session: https://claude.ai/code/session_01FPQb6z3YwcKRMbvoJhdxnX
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR updates Docker build-context ignore rules for the root and docs directories, reworks the docs Dockerfile to strip JS tooling and serve via Thruster in front of Puma, adds the thruster gem and a bin/thrust launcher, switches docs-kit gem sourcing to RubyGems, refines AGENTS.md authoring guidance, and adds a rake task for generating Open Graph share images. ChangesDocker/Thruster deployment changes
Documentation and tooling additions
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant Thruster as "bin/thrust"
participant Puma as "rails server"
Client->>Thruster: HTTP request on HTTP_PORT 3000
Thruster->>Puma: proxy to TARGET_PORT 3001
Puma-->>Thruster: response
Thruster-->>Client: response
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/lib/tasks/docs_kit_og.rake`:
- Around line 27-31: The multiline hash assigned to sizes in the docs_kit_og
rake task is missing a trailing comma on the last entry, which triggers the
RuboCop offense. Update the sizes hash so the square.png entry in that block
includes the trailing comma, keeping the hash formatting consistent and
lint-clean.
- Line 32: The path construction in docs_kit_og.rake should use Rails’ preferred
join style to satisfy Rails/FilePath. Update the out_dir assignment to build the
OG image path with separate segments via Rails.root.join in the task code,
keeping the existing meaning but making the path idiomatic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: dac8934a-7580-4991-bd60-557d55242fb2
⛔ Files ignored due to path filters (1)
docs/Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
.dockerignoredocs/.dockerignoredocs/AGENTS.mddocs/Dockerfiledocs/Gemfiledocs/bin/thrustdocs/lib/tasks/docs_kit_og.rake
…d local cop copy The 1.0.3 sync installed lib/tasks/docs_kit_og.rake, which tripped this site's stricter RuboCop config (trailing comma, Rails/FilePath arguments style) — autocorrected to the site style. Also removed the hand-copied RenderComponentPreferred cop + its require: the docs-kit gem ships the cop (docs_kit/rubocop, already wired), and loading both produced constant-redefinition warnings on every lint run. Claude-Session: https://claude.ai/code/session_01FPQb6z3YwcKRMbvoJhdxnX
Summary
Dogfoods the docs-kit 1.0.3 Docker/Thruster improvements into this repo's docs site (part of the rollout across daisyui / phlex-reactive / pgbus).
github: "mhenrixon/docs-kit"(locked to a pre-1.0 SHA, gemspec 0.1.0) →gem "docs-kit", "~> 1.0.3"from RubyGems. The GitHub-ref rationale (sibling repo outside the Docker build context) is obsolete now the gem is released.gem "thruster"+bin/thrust(scaffolded live by 1.0.3'sdocs_kit:install --sync— its newcreate_thrust_binstubstep).CMD ["./bin/thrust", "./bin/rails", "server"]withHTTP_PORT=3000(the routed port: Kamalapp_port, EXPOSE, healthcheck) andTARGET_PORT=3001(Puma, unpublished).rm -rf node_modules /usr/local/bunafterassets:precompile— previously ~103 MB ofdocs/node_modulesshipped in the finalCOPY /gem.tmp/cacheis deliberately kept (it holds the bootsnap cache built one step earlier — documented in the Dockerfile)..dockerignorecoverage/,pkg/,tmp/,.rspec_status,.worktrees, docs coverage/rspec files.docs/.dockerignorerefreshed by the generator (gem-owned; inert here since the build context is the repo root).--syncwiringlib/tasks/docs_kit_og.rake, AGENTS.md docs-kit block refresh (adds theoperationhelper docs).Preserved verbatim: the
/gem+/gem/docslayout (asset_pathcoupling),LABEL service="daisyui", ENTRYPOINT, SQLite/litestack env +VOLUME /data, Ruby 4.0.2 base, layered COPY strategy,EXPOSE 3000+app_port: 3000.Verification
docker build -f docs/Dockerfile .(repo-root context) — 554 MB, final image verifiednode_modules-freeServer started http: ":3000", Puma binds:3001(TARGET_PORT honored),/up→ 200, CSS asset returnsContent-Encoding: gzip+X-Cache: miss— Puma alone never compressesNotes
>= 4.0, < 5constraint — specs green; widening the constraint upstream is being considered.--syncinitializer diff hint was reviewed: remaining drift is intentional site customization (brand, curated themes, nav); the new opt-in knobs (c.topbar_links,c.seo.*) are available but not wired here.https://claude.ai/code/session_01FPQb6z3YwcKRMbvoJhdxnX
Summary by CodeRabbit
New Features
Bug Fixes