Single-container deployment — API serves the Expo Web bundle as static fallback #186

Closed
opened 2026-06-20 15:44:48 +00:00 by james · 0 comments
Owner

The API container also serves the Expo Web static bundle, so self-hosters still run one image. API routes are served from /api/*; everything else falls through to the static bundle, with SPA-style index.html fallback for client-side routes.

Scope

  • Multi-stage Dockerfile: build apps/api, build apps/client (web target), copy the static bundle into the API image.
  • Next.js static-file serving (or a thin middleware) returns apps/client/dist/index.html for any non-/api/* route that doesn't match a static asset.
  • Headers: long cache on hashed assets, no-cache on index.html.
  • Verify the PWA install prompt + service worker continue to work served this way.
  • Update README "Quickstart" if the run command changes.

Acceptance criteria

  • docker run carol exposes the API at /api/* and serves the Expo Web bundle for every other path.
  • PWA install prompt fires on supported browsers; offline shell loads.
  • Image size hasn't grown by more than ~20% vs. the pre-split image.
  • No new self-hoster env vars (README "Configuration" tables unchanged unless a real new var lands).

Out of scope

  • Native packaging (Android, Flatpak — separate tickets).
  • Reverse proxy guidance — already in README.

Composes with

Decommission Next.js UI, Expo client scaffolding.

Part of

#176

The API container also serves the Expo Web static bundle, so self-hosters still run one image. API routes are served from `/api/*`; everything else falls through to the static bundle, with SPA-style `index.html` fallback for client-side routes. ## Scope - Multi-stage Dockerfile: build `apps/api`, build `apps/client` (web target), copy the static bundle into the API image. - Next.js static-file serving (or a thin middleware) returns `apps/client/dist/index.html` for any non-`/api/*` route that doesn't match a static asset. - Headers: long cache on hashed assets, no-cache on `index.html`. - Verify the PWA install prompt + service worker continue to work served this way. - Update README "Quickstart" if the run command changes. ## Acceptance criteria - [ ] `docker run carol` exposes the API at `/api/*` and serves the Expo Web bundle for every other path. - [ ] PWA install prompt fires on supported browsers; offline shell loads. - [ ] Image size hasn't grown by more than ~20% vs. the pre-split image. - [ ] No new self-hoster env vars (README "Configuration" tables unchanged unless a real new var lands). ## Out of scope - Native packaging (Android, Flatpak — separate tickets). - Reverse proxy guidance — already in README. ## Composes with Decommission Next.js UI, Expo client scaffolding. ## Part of #176
james closed this issue 2026-06-21 13:19:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/carol#186
No description provided.