Skip to content

fix(docker): make the web image build and produce a working self-host SPA - #365

Open
tlvenn wants to merge 1 commit into
MapleTechLabs:mainfrom
tlvenn:fix-web-docker-build
Open

fix(docker): make the web image build and produce a working self-host SPA#365
tlvenn wants to merge 1 commit into
MapleTechLabs:mainfrom
tlvenn:fix-web-docker-build

Conversation

@tlvenn

@tlvenn tlvenn commented Aug 8, 2026

Copy link
Copy Markdown

First slice of the fixes offered in #352 — the smallest set that makes apps/web/Dockerfile build from a clean checkout and produce a usable self-host image:

  • Declare @maple-dev/browser in apps/web — it's imported by apps/web/src (session replay + main.tsx) but was never in package.json, so it only resolved via workspace hoisting. turbo prune @maple/web --docker therefore omits packages/browser from the pruned tree and the image build fails at bun run --cwd packages/browser build (ENOENT). Declaring the dependency fixes prune and is honest about the real dependency graph. (bun.lock delta is the one matching line.)
  • Build lib/clickhouse-builder before the web bundle@maple/query-engine imports @maple-dev/clickhouse-builder/sql and /expr, which are dist/ subpath exports; without building it first, vite fails with Rolldown failed to resolve import "@maple-dev/clickhouse-builder/sql".
  • Add VITE_ELECTRIC_SYNC_URL as a build arg — Electric shapes are the only read path for dashboards/alerts/error-issue lists, and the URL is baked at build time (apps/web/src/lib/services/common/electric-sync-url.ts), so a Docker-built SPA needs a way to set it. Defaults unchanged when unset.

Verified by building the image from a clean checkout of main and serving it (we run this image in our self-hosted deployment). Happy to follow up with the api Dockerfile / compose cleanup once you've said whether you'd rather fix or remove those (#352).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

… SPA

- Declare @maple-dev/browser in apps/web — it is imported by apps/web/src
  but resolved only via workspace hoisting, so turbo prune --docker omits
  packages/browser and the image build fails at its dist build step.
- Build lib/clickhouse-builder before the web bundle — @maple/query-engine
  imports its dist/ subpath exports; without it vite fails to resolve
  @maple-dev/clickhouse-builder/sql.
- Add VITE_ELECTRIC_SYNC_URL build arg — Electric shapes are the only
  read path for dashboards/alerts/error lists and the URL is baked at
  build time, so a Docker-built SPA needs a way to set it.
@tlvenn
tlvenn force-pushed the fix-web-docker-build branch from bbc41c1 to 2f6b286 Compare August 8, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant