feat(self-host): full Docker Compose self-hosting via a Miniflare runtime - #450
Open
tlvenn wants to merge 1 commit into
Open
feat(self-host): full Docker Compose self-hosting via a Miniflare runtime#450tlvenn wants to merge 1 commit into
tlvenn wants to merge 1 commit into
Conversation
…time Adds a complete, working path for running Maple outside Cloudflare — no Tinybird, no managed platform. apps/api, apps/alerting, and apps/electric-sync are Cloudflare Workers with no plain-HTTP entry point. deploy/workerd/ runs their Wrangler bundles under Miniflare in one container, deriving every binding and cron schedule from each worker's own wrangler.jsonc at boot (so it tracks upstream config with no manual mirroring), reaching Postgres through the Hyperdrive binding and running the drizzle migrations (incl. the Electric publication) on startup. docker-compose.selfhost.yml wires the full stack: postgres + electric (control plane / shape sync), clickhouse + ch-migrate + collector (telemetry), the workerd container, the web SPA, and a Caddy reverse proxy giving one origin (/api -> api worker, /sync -> electric-sync, /* -> SPA). docs/self-hosting.md is the guide; .env.selfhost.example lists the config. Also removes the dead apps/api/Dockerfile (its `bun run start` CMD has no matching script; the api is a Worker) and reverts docker-compose.yml to the postgres+electric dev-DB role its header documents. Validated end-to-end from a clean boot: ClickHouse + Postgres migrations, self-hosted login, and the Electric dashboards shape all succeed through the proxy; a smoke trace reaches the collector. Runtime note: Miniflare is the working path today; celld is the eventual target once it can run the api (TCP/Hyperdrive, cron, KV/Queues), per MapleTechLabs#352.
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.
Follow-up to #365, delivering the full self-hosted path discussed in #352 — run Maple outside Cloudflare, no Tinybird.
apps/api,apps/alerting, andapps/electric-syncare Workers with no plain-HTTP entry.deploy/workerd/runs their Wrangler bundles under Miniflare in one container — deriving every binding and cron from each worker's ownwrangler.jsoncat boot, so it tracks config changes here with no manual mirroring. It reaches Postgres via the Hyperdrive binding and runs the drizzle migrations (incl. the Electric publication) on startup.docker-compose.selfhost.ymlwires the whole stack — postgres + electric, clickhouse + ch-migrate + collector, workerd, the web SPA, and a Caddy proxy giving one origin (/api→api,/sync→electric-sync,/*→SPA).docs/self-hosting.mdis the guide;.env.selfhost.examplethe config. Also removes the deadapps/api/Dockerfile(itsbun run startCMD has no matching script; the api is a Worker) and revertsdocker-compose.ymlto the postgres+electric dev-DB role its header documents.Validated end-to-end from a clean
docker compose -f docker-compose.selfhost.yml up: ClickHouse + Postgres migrations, self-hosted login, and the Electricdashboardsshape all succeed through the proxy; a smoke trace reaches the collector.Runtime note: Miniflare is the working path today; celld is the natural target once it can run the api (TCP/Hyperdrive→Postgres, cron/
scheduled, KV/Queues) — happy to help move there when those land.Structural choices I'd welcome your steer on:
docker-compose.selfhost.ymlrather than reworking the rootdocker-compose.yml(kept as yourwrangler devdev-DB), so the two don't conflate. Happy to merge them if you'd prefer one.http://localhost:3471experience; drop it if you'd rather document a bring-your-own ingress.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.