feat: add Docker dev environment with live reload#1
Open
WilsonNet wants to merge 1 commit intoprofusion:mainfrom
Open
feat: add Docker dev environment with live reload#1WilsonNet wants to merge 1 commit intoprofusion:mainfrom
WilsonNet wants to merge 1 commit intoprofusion:mainfrom
Conversation
677eac3 to
bfea109
Compare
Adds docker-compose.dev.yml for local development with automatic live reload for both backend and frontend. No changes to existing files. - docker-compose.dev.yml: standalone dev stack (Django runserver + Vite HMR) using the same env file conventions as production - dashboard/Dockerfile.dev: lightweight node image running pnpm dev with src/ and public/ mounted for HMR - proxy/etc/nginx/templates/dev.conf.template: dev nginx config that proxies / to Vite (with WebSocket upgrade for HMR) instead of serving static files - docs/dev-environment.md: contributor docs covering setup, live reload mechanics, migration workflow, edge cases (syntax errors, stale pyc, deleted files, circular imports, package.json changes), and the Docker Desktop inode caveat with workarounds - extend inode caveat to cover macOS and add OrbStack as workaround - remove redundant --build from initial setup command - clarify when --build is needed and what it does - add Swagger UI and ReDoc links to dev environment doc - expose postgres port 5432 and document SQL client connection
bfea109 to
5ade0c6
Compare
giubrocchi
approved these changes
Apr 8, 2026
Collaborator
giubrocchi
left a comment
There was a problem hiding this comment.
Nice, thanks for the help!
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
Adds a `docker-compose.dev.yml` for local development with automatic live reload for both backend and frontend. No existing files are modified.
How to use
Access at `http://localhost:9000\` (same URL as production).
Live reload mechanisms
TanStack Router codegen fix (`TSR_TMP_DIR`)
TanStack Router generates `routeTree.gen.ts` by writing a temp file then atomically renaming it to the destination. Atomic rename means: write the full content to a throwaway file first, then swap it into place in one instant — so nobody ever sees a half-written file.
The problem in Docker: the rename was crossing two different filesystem address spaces:
Linux forbids rename across different address spaces (EXDEV error), so the route tree was never updated when new route files were added.
Fix: `TSR_TMP_DIR=/dashboard/src/.tanstack-tmp` moves the temp file inside the `src/` bind mount. Now both paths live in the same address space and the rename succeeds. The `src/.tanstack-tmp/` directory is gitignored.
This works on all setups (native Docker Engine on Linux, Docker Desktop on Linux/macOS, OrbStack) because the fix is about keeping both ends of the rename inside the same bind mount entry — not about which OS or VM layer is underneath.
Test plan