Add Docker Compose dev stack and local Supabase setup#44
Open
0xNadr wants to merge 1 commit intowillchen96:mainfrom
Open
Add Docker Compose dev stack and local Supabase setup#440xNadr wants to merge 1 commit intowillchen96:mainfrom
0xNadr wants to merge 1 commit intowillchen96:mainfrom
Conversation
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.
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.
Summary
docker compose upnow brings up frontend (:4000) and backend (:4001) with bind-mounted source for hot reload.supabase initscaffolding plus the existing one-shot schema copied intosupabase/migrations/, sosupabase startbrings up local Postgres + Auth + Storage + Realtime and auto-applies the schema.host.docker.internalfor server-side,localhostfor browser), and the one-time storage bucket bootstrap.The container
commandrunsnpm installon start instead of relying on the image's bakednode_modules. This works around a Docker Desktop quirk where a named volume mounted on top of a bind-mounted/appgets a partial copy ofnode_modulesfrom the image (e.g. Next was missingformat-cli-help-output).Default ports moved to
4000/4001to avoid colliding with anything else commonly running on3000/3001. The legacynpm run devworkflow still uses3000/3001and is unaffected.Test plan
supabase startbrings up the Supabase stack and applies the migration (15 tables inpublic)docker compose up -dstarts both Mike servicescurl http://localhost:4001/healthreturns{"ok":true}curl http://localhost:4000/redirects to/assistant(HTTP 200, ~30KB)host.docker.internal:54321