Skip to content

dogfood: bake the ui-website registry into the deploy image (Bun serve 500s without it) #526

@vivek7405

Description

@vivek7405

Problem

After switching the in-repo app deploys to serve on Bun (#522), the ui-website component detail pages 500'd in production (ResolveMessage: Cannot find module '../../../../components/ui/accordion.ts'). Root cause: the components/ui/*.ts files those pages import are GENERATED at the ui-website npm prestart hook (node scripts/copy-registry.js), not baked into the deploy image. The Dockerfile bakes Tailwind css at build time but NOT the registry copy, so any start path that bypasses npm run start (the direct bun webjs.js start) is missing the files. The home pages worked (they do not import the generated files), which is why a home-route-only smoke check missed it.

Design / approach

Bake the registry copy into the Dockerfile at build time, next to the existing Tailwind step (copy-registry.js is pure filesystem, no runtime/network/DB deps, so it is build-safe). Then the generated components/ui/ ships in the image and EVERY start path (npm, direct bun, compose) resolves them, matching the Dockerfile's existing "bake static assets at build" pattern. Runtime-only prestart steps (the blog's prisma migrate deploy, which needs the DB volume) stay in the start command. Also harden the four-app dogfood smoke to probe a registry-backed ui-website route, not just the home page, so this class of bug fails the check.

Acceptance criteria

  • Dockerfile bakes the ui-website registry components at build time.
  • docker compose up serves ui-website component DETAIL pages (e.g. /docs/components/progress), not just the home page, on Bun.
  • The four-app boot check probes a registry-backed route.
  • Deployment docs recipe notes that runtime-dependent prestart (migrations) stays in the start command.
  • All 4 Railway services serve correctly on Bun.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions