docs(selfhost): document measured resource profiles and trim image bloat - #3198
Merged
Conversation
…oat (#1828) Add a measured-vs-estimated resource profile matrix (CPU/memory per compose profile, plus disk) to the self-host operations docs, sourced from a real production instance running the full profile set. Audit docker-compose.yml's memory limits against that data: none look miscalibrated enough to change. Also trim the runtime image by ~188MB (942MB -> 754MB, measured): the AI CLI install left ~180MB of npm download cache baked into the image with zero runtime use, and the Docker build context carried the unused gittensory-ui app and test suite (never read by the self-host bundle's entry point).
The prior commit's edit accidentally dropped the "Docker resource hygiene" h2 and its lead paragraph while inserting the new resource-profile matrix ahead of it, leaving the section's install/prune instructions orphaned under no heading. Restore the heading and intro paragraph in place.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 09e7d7b | Commit Preview URL Branch Preview URL |
Jul 04 2026, 07:37 PM |
Contributor
|
Important 🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪 🔍 Gittensory is reviewing…AI analysis is in progress. This comment will update when the review is complete. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docker-compose.ymlprofile, plus a disk breakdown, sourced from realdocker stats/docker system dfsnapshots on a production instance running the full profile set (qdrant+redis+observability+backup+postgres+ollama).deploy.resources.limits.memorydefault against that measured data and documents the conclusion: none look miscalibrated enough to change right now (closest is Grafana at ~60% of its 512MiB limit, which still has real headroom). This is a no-op ondocker-compose.ymllimits, made explicit in the docs rather than guessed at.docker build/docker images):npm install -gfor the bundled Claude Code / Codex CLIs was leaving ~180MB of npm download cache (~/.npm/_cacache) baked into the image with zero runtime use;npm cache clean --forceafter the install removes it. Also excludes the unusedapps/(gittensory-ui) andtest/directories from the Docker build context via.dockerignore— the self-host bundle's only entry point issrc/server.tsandnpm cionly ever sees the rootpackage*.json(copied before the rest of the tree), so neither directory is ever read during the image build.What this PR does NOT do (remaining #1828 scope)
--profile runnersstill ships with no CPU/memory limit (documented as a known, deliberate gap — seedocker-compose.override.yml.example— rather than something this PR fixes, since the right ceiling is host-specific).Measured vs. estimated, explicitly
docker stats/docker system dfsnapshot, full profile set, steady state): app 2.6% CPU / 365MiB of 2GiB; postgres 14.24% CPU / 196MiB of 2GiB (highest CPU); grafana 305MiB of 512MiB (~60%); tempo 209MiB of 1GiB (~20%); disk 48GB/151GB (32%) used, withdocker system dfImages/Volumes/Build-cache reclaimable percentages as reported.--profile runnersrisk — each is called out in the docs table as estimated, with the reasoning shown.docker build --target runtime) before and after the fix, confirmed the size delta and inspected/home/node/.npm/_cacache(180M) and/home/node/.npm-global(465M) inside the built container directly.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --check— ran, clean.npm run actionlint— not run; no.github/workflows/**changes in this PR.npm run typecheck— clean.npm run test:coveragelocally — not run; this PR has zerosrc/**changes (docs + Dockerfile + .dockerignore only), so there is no Codecov patch obligation.npm run test:workers— not run for the same reason (nosrc/**/worker changes).npm run build:mcp/npm run test:mcp-pack— not run; no MCP package changes.npm run ui:openapi:check— not run; no API/OpenAPI schema changes.npm run ui:lint— clean (0 errors; only the same pre-existingreact-refresh/only-export-componentswarning every other route file in this directory already has).npm run ui:typecheck— clean.npm run ui:build— clean,docs.self-hosting-operationsbundle built successfully.npm audit --audit-level=moderate— not run for this docs/Dockerfile-only change; no dependency changes.src/**logic changed.Additionally validated outside the standard checklist (Docker image change, not covered by the JS test suite):
docker build --target runtimebefore and after theDockerfilechange; confirmed the final image shrank from 942MB to 754MB.claude --versionandcodex --versioninside the container to confirm the AI CLIs still work correctly afternpm cache clean --force.docker build --no-cacheafter the.dockerignorechange to confirmnpm ciandscripts/build-selfhost.mjsstill succeed withapps/andtest/excluded from the build context.SELFHOST_SETUP_TOKEN/PUBLIC_API_ORIGIN), i.e. the bundle executes correctly end-to-end.If any required check was skipped, explain why:
src/**(onlyapps/gittensory-ui/src/routes/**docs,Dockerfile, and.dockerignore), so the Codecov-gated JS checks (test:coverage,test:workers,build:mcp,test:mcp-pack,ui:openapi:check,npm audit) don't apply — there is no changedsrc/**line for them to cover, and no dependency or OpenAPI change to check.actionlintdoesn't apply because no workflow files changed.Safety
UI Evidencesection below.CHANGELOG.mduntouched.)UI Evidence
This is a docs-only content addition to an existing, unstyled prose page (new
<h2>/<h3>/<table>content using the sameDocsPage/FeatureRowprimitives andborder-hairline/divide-hairlinedesign tokens already used elsewhere on this exact page) — no new components, layout, or visual design were introduced.A full-page screenshot of the new section deep in the page could not be captured in this sandboxed environment: the preview tool's screenshot capture reproducibly returns a blank/black image at any non-zero scroll position on this route, and this reproduces identically on an unmodified sibling docs page (
self-hosting-backup-scaling), confirming it is a pre-existing environment/tooling limitation and not caused by this change.What was verified instead:
<table class="w-full border-collapse ...">etc.).npm run ui:buildsucceeds and produces thedocs.self-hosting-operationsroute bundle with the new content included.Notes
.dockerignorefindings were discovered by actually building the image locally (docker build --target runtime -t ... .) and inspecting the resulting layers withdocker history --no-truncanddocker run ... du -sh, rather than guessed — see the Validation section above for the exact before/after numbers.main) covers the update/rollback documentation gap called out in this issue's parent thread; this PR does not touch that file (docs.self-hosting-releases.tsx) and there is no overlap.