Skip to content

chore(docs): upgrade to docs-kit 1.0.3 — Thruster CMD + Docker image slimming - #33

Merged
mhenrixon merged 2 commits into
mainfrom
chore/docs-kit-1-0-3-docker-thruster
Jul 4, 2026
Merged

chore(docs): upgrade to docs-kit 1.0.3 — Thruster CMD + Docker image slimming#33
mhenrixon merged 2 commits into
mainfrom
chore/docs-kit-1-0-3-docker-thruster

Conversation

@mhenrixon

@mhenrixon mhenrixon commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

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).

Change Detail
Released gem 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.
Thruster fronts Puma New gem "thruster" + bin/thrust (scaffolded live by 1.0.3's docs_kit:install --sync — its new create_thrust_binstub step). CMD ["./bin/thrust", "./bin/rails", "server"] with HTTP_PORT=3000 (the routed port: Kamal app_port, EXPOSE, healthcheck) and TARGET_PORT=3001 (Puma, unpublished).
Image slimming rm -rf node_modules /usr/local/bun after assets:precompile — previously ~103 MB of docs/node_modules shipped in the final COPY /gem. tmp/cache is deliberately kept (it holds the bootsnap cache built one step earlier — documented in the Dockerfile).
.dockerignore Root: added coverage/, pkg/, tmp/, .rspec_status, .worktrees, docs coverage/rspec files. docs/.dockerignore refreshed by the generator (gem-owned; inert here since the build context is the repo root).
--sync wiring New lib/tasks/docs_kit_og.rake, AGENTS.md docs-kit block refresh (adds the operation helper docs).

Preserved verbatim: the /gem + /gem/docs layout (asset_path coupling), 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 verified node_modules-free
  • Thruster proven serving: Thruster logs Server started http: ":3000", Puma binds :3001 (TARGET_PORT honored), /up → 200, CSS asset returns Content-Encoding: gzip + X-Cache: miss — Puma alone never compresses
  • Docs suite: 8 examples, 0 failures (the full suite — no system spec files exist)
  • No API drift surfaced from the pre-1.0 SHA → 1.0.3 jump

Notes

  • rouge was downgraded 5.0.0 → 4.7.0 by docs-kit's >= 4.0, < 5 constraint — specs green; widening the constraint upstream is being considered.
  • The --sync initializer 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

    • Added a docs-site workflow for generating social sharing images in standard sizes.
    • Updated the docs site to run behind a proxy-aware startup setup for more consistent production behavior.
  • Bug Fixes

    • Reduced Docker build context by excluding more temporary, coverage, and build artifacts.
    • Tightened docs build exclusions to avoid bundling unnecessary files and outputs.

…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
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aa89cc5c-151d-4439-ad54-bd18ce9b27c7

📥 Commits

Reviewing files that changed from the base of the PR and between 1718915 and ceb8ef3.

📒 Files selected for processing (3)
  • docs/.rubocop.yml
  • docs/lib/rubocop/cop/docs_kit/render_component_preferred.rb
  • docs/lib/tasks/docs_kit_og.rake
📝 Walkthrough

Walkthrough

This 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.

Changes

Docker/Thruster deployment changes

Layer / File(s) Summary
Docker build context ignore rules
.dockerignore, docs/.dockerignore
Expanded ignore patterns for coverage, build/package output, temp files, bundler workdir, worktrees, rspec status, git metadata, env/credentials, logs/tmp/pids, assets, specs, CI/deploy metadata, and editor/AI tooling.
Thruster integration for docs runtime
docs/Gemfile, docs/bin/thrust, docs/Dockerfile
Gemfile adds thruster and switches docs-kit to a RubyGems version constraint; bin/thrust loads the thruster executable; Dockerfile removes node_modules/Bun after asset precompile and runs ./bin/thrust in front of Puma with HTTP_PORT/TARGET_PORT env vars.

Documentation and tooling additions

Layer / File(s) Summary
Authoring contract updates
docs/AGENTS.md
Refines guidance on avoiding parentheses in wrapper helpers and adds a bullet describing OpenAPI-backed endpoint rendering via operation "operationId" with clients: tab filtering.
Open Graph image generation rake task
docs/lib/tasks/docs_kit_og.rake
New docs_kit:og task generates og.png, twitter.png, and square.png screenshots of the docs landing page, configurable via DOCS_KIT_OG_URL and DOCS_KIT_SHOT env vars.

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
Loading

Possibly related PRs

  • mhenrixon/daisyui#26: Also modifies docs/Gemfile to change how the docs-kit gem is sourced/versioned.

Suggested labels: documentation, enhancement

Poem

A rabbit hopped through Docker's maze,
Trimmed the bloat in a dozen ways 🐇
Thruster now leads Puma's dance,
Ignoring files by happy chance,
Og images snap, the docs now shine—
Hop hop hooray, the build is fine!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: docs-kit 1.0.3 upgrade, Thruster startup change, and Docker image slimming.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 12cc90e and 1718915.

⛔ Files ignored due to path filters (1)
  • docs/Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • .dockerignore
  • docs/.dockerignore
  • docs/AGENTS.md
  • docs/Dockerfile
  • docs/Gemfile
  • docs/bin/thrust
  • docs/lib/tasks/docs_kit_og.rake

Comment thread docs/lib/tasks/docs_kit_og.rake
Comment thread docs/lib/tasks/docs_kit_og.rake Outdated
…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
@mhenrixon
mhenrixon merged commit 46c3d1e into main Jul 4, 2026
8 checks passed
@mhenrixon
mhenrixon deleted the chore/docs-kit-1-0-3-docker-thruster branch July 4, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant