build(container): use turbo pruned web workspace #36

Merged
vince merged 2 commits from codex/turbo-pruned-container into main 2026-06-20 07:15:09 +02:00
Owner

Summary

  • Rewrite apps/web/Containerfile to use turbo prune @dimensionlab/web --docker.
  • Install dependencies from the pruned out/json manifest set, then build from out/full.
  • Keep the runtime image slim by copying only the built web server, Vite assets, and migrations.
  • Ignore local out/ prune output in git and container contexts.

Why

The monorepo package structure is now real, so the internal container should follow Turborepo deploy packaging instead of manually staging workspace manifests and copying the full repo into the build stage.

Changes

  • Add a pruner stage to generate the web deploy subset.
  • Use pruned manifests for bun install --frozen-lockfile.
  • Copy root TypeScript configs from the pruner stage because package builds extend them and Turbo prune does not emit them into out/full.
  • Update workspace boundary tests and deployment docs.

Testing

  • Red test: bun run --cwd apps/web test:unit src/lib/workspace-boundary.test.ts failed before Containerfile changes on missing AS pruner.
  • Red test: full podman build -f apps/web/Containerfile ... failed before copying root TypeScript configs because tsconfig.base.json was missing in the pruned build context.
  • bun run --cwd apps/web test:unit src/lib/workspace-boundary.test.ts
  • bun run check
  • podman build --target deps -f apps/web/Containerfile .
  • bun run test:qa
  • bun run db:check
  • podman build -f apps/web/Containerfile -t localhost/dimensionlab-website:codex-pruned .
  • Container smoke: served / and /api/dashboard from the built image.
  • Runtime image content check: only /repo/apps/web/{build,dist,drizzle} present; no /repo/packages or root node_modules.
  • git diff --check

Notes

  • The runtime image intentionally does not copy workspace source or root dependencies; the Bun server bundle and static assets are sufficient for the smoke-verified runtime path.
## Summary - Rewrite `apps/web/Containerfile` to use `turbo prune @dimensionlab/web --docker`. - Install dependencies from the pruned `out/json` manifest set, then build from `out/full`. - Keep the runtime image slim by copying only the built web server, Vite assets, and migrations. - Ignore local `out/` prune output in git and container contexts. ## Why The monorepo package structure is now real, so the internal container should follow Turborepo deploy packaging instead of manually staging workspace manifests and copying the full repo into the build stage. ## Changes - Add a `pruner` stage to generate the web deploy subset. - Use pruned manifests for `bun install --frozen-lockfile`. - Copy root TypeScript configs from the pruner stage because package builds extend them and Turbo prune does not emit them into `out/full`. - Update workspace boundary tests and deployment docs. ## Testing - Red test: `bun run --cwd apps/web test:unit src/lib/workspace-boundary.test.ts` failed before Containerfile changes on missing `AS pruner`. - Red test: full `podman build -f apps/web/Containerfile ...` failed before copying root TypeScript configs because `tsconfig.base.json` was missing in the pruned build context. - `bun run --cwd apps/web test:unit src/lib/workspace-boundary.test.ts` - `bun run check` - `podman build --target deps -f apps/web/Containerfile .` - `bun run test:qa` - `bun run db:check` - `podman build -f apps/web/Containerfile -t localhost/dimensionlab-website:codex-pruned .` - Container smoke: served `/` and `/api/dashboard` from the built image. - Runtime image content check: only `/repo/apps/web/{build,dist,drizzle}` present; no `/repo/packages` or root `node_modules`. - `git diff --check` ## Notes - The runtime image intentionally does not copy workspace source or root dependencies; the Bun server bundle and static assets are sufficient for the smoke-verified runtime path.
vince added 1 commit 2026-06-20 07:01:36 +02:00
vince added 1 commit 2026-06-20 07:12:52 +02:00
vince merged commit 9240ae4925 into main 2026-06-20 07:15:09 +02:00
Sign in to join this conversation.
No description provided.