Skip to content

Add Docker Compose dev stack and local Supabase setup#44

Open
0xNadr wants to merge 1 commit into
willchen96:mainfrom
0xNadr:local-docker-setup
Open

Add Docker Compose dev stack and local Supabase setup#44
0xNadr wants to merge 1 commit into
willchen96:mainfrom
0xNadr:local-docker-setup

Conversation

@0xNadr
Copy link
Copy Markdown

@0xNadr 0xNadr commented May 8, 2026

Summary

  • docker compose up now brings up frontend (:4000) and backend (:4001) with bind-mounted source for hot reload.
  • supabase init scaffolding plus the existing one-shot schema copied into supabase/migrations/, so supabase start brings up local Postgres + Auth + Storage + Realtime and auto-applies the schema.
  • README gains a "Run locally with Docker" section above the existing manual setup, including ports, env wiring (host.docker.internal for server-side, localhost for browser), and the one-time storage bucket bootstrap.

The container command runs npm install on start instead of relying on the image's baked node_modules. This works around a Docker Desktop quirk where a named volume mounted on top of a bind-mounted /app gets a partial copy of node_modules from the image (e.g. Next was missing format-cli-help-output).

Default ports moved to 4000/4001 to avoid colliding with anything else commonly running on 3000/3001. The legacy npm run dev workflow still uses 3000/3001 and is unaffected.

Test plan

  • supabase start brings up the Supabase stack and applies the migration (15 tables in public)
  • docker compose up -d starts both Mike services
  • curl http://localhost:4001/health returns {"ok":true}
  • curl http://localhost:4000/ redirects to /assistant (HTTP 200, ~30KB)
  • Backend container reaches Supabase Auth via host.docker.internal:54321
  • Source edits hot-reload inside both containers

Two services in docker-compose.yml (frontend on :4000, backend on :4001)
with bind-mounted source for hot reload. Container command runs `npm install`
on start to work around a Docker Desktop named-volume init quirk where
node_modules from the image gets a partial copy when overlapped by a bind
mount.

`supabase init` scaffolding with the existing one-shot schema copied into
supabase/migrations/ so `supabase start` brings up Postgres + Auth +
Storage + Realtime locally and applies the schema automatically.

README: new "Run locally with Docker" section covering ports, env wiring
(host.docker.internal for server-side, localhost for browser), and the
storage bucket bootstrap.
amal66 added a commit to amal66/mike that referenced this pull request May 25, 2026
Chapter: 27 - Self-hosting path.

Plain-English map:
Add Dockerfiles and Docker Compose configuration so contributors can run a
local web/API setup with less manual environment work.

Why it matters:
If local setup is fragile, forks drift because everyone solves deployment
differently. A supported path keeps more work shareable upstream.

Principle:
Self-hosting should be boring and documented.

Precedent borrowed:
Upstream PRs willchen96#44, willchen96#63, and willchen96#149 plus the fork report's large local/self-hosted
stack cluster.

Upstream base: willchen96/mike@d39f580.
Original local commit: b2ae01c.
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