Skip to content

feat: add Docker Compose dev environment - #27

Merged
MCR-3 merged 1 commit into
mainfrom
26-docker-compose-dev-environment
Sep 22, 2026
Merged

MCR-3 merged 1 commit into
mainfrom
26-docker-compose-dev-environment

Conversation

@MCR-3

@MCR-3 MCR-3 commented Sep 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Add backend/Dockerfile.dev and frontend/Dockerfile.dev (deps baked in at build time) plus compose.yaml, so docker compose up runs the backend (--reload, port 8000) and frontend (Vite HMR, port 5173) with source bind-mounted in — no local venv or node_modules needed.
  • Update CLAUDE.md to make docker compose up the primary documented dev path, with the manual venv/npm steps kept as a fallback; verification commands (build/lint/analyzer) now documented via docker compose exec.
  • Fix two things hot-reload verification surfaced: Vite's watcher never saw bind-mounted changes under Docker Desktop on Windows (fixed via a VITE_USE_POLLING-gated usePolling option, so local non-Docker dev is unaffected), and oxlint's node_modules exclusion was only working locally via ambient .gitignore discovery — made explicit in .oxlintrc.json since the frontend container's bind mount has no .git.
  • Scope the backend reloader to backend/ only (--reload-dir) and add per-service .dockerignores, so builds don't ship or watch unrelated large directories like frontend/node_modules.

The existing root Dockerfile and render.yaml (Render deploy) and the GitHub Pages workflow are untouched — this is dev tooling only.

Closes #26

Test plan

  • docker compose build — both images build clean
  • docker compose up — backend GET /api/health returns {"status":"ok"}, frontend serves 200 on /
  • Edited backend/main.py and frontend/src/App.tsx while the stack was running — both hot-reloaded
  • docker compose exec backend python -m backend.analyzer sample_project — succeeds
  • docker compose exec frontend npm run lint — 0 warnings/errors (was linting node_modules before the .oxlintrc.json fix)
  • docker compose exec frontend npm run build — succeeds
  • /code-review medium run against the diff; both findings (repo-wide reload watch, missing per-service .dockerignore) fixed and re-verified

Running the app locally meant managing a Python venv and installing
frontend dependencies by hand, then starting uvicorn and Vite as two
separate manual processes. `docker compose up` now boots both with
hot reload, so neither is required for day-to-day development.

- backend/Dockerfile.dev and frontend/Dockerfile.dev install
  dependencies at build time; source is bind-mounted in for reload/HMR.
- compose.yaml wires them up on the same ports (8000/5173) the manual
  workflow already used. Verification (build/lint/analyzer) runs via
  `docker compose exec`.
- Vite's watcher needs polling to see bind-mounted changes under
  Docker Desktop on Windows; gated behind VITE_USE_POLLING so local
  (non-Docker) dev is unaffected.
- .oxlintrc.json now ignores node_modules/dist explicitly rather than
  relying on the ambient .gitignore, since the frontend container's
  bind mount has no .git to discover it from.
- The dev Dockerfiles/compose.yaml are entirely separate from the
  root Dockerfile and render.yaml, which still drive the Render and
  GitHub Pages deploys unchanged.

Closes #26
@MCR-3
MCR-3 merged commit 41e78be into main Sep 22, 2026
2 checks passed
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.

Add Docker Compose dev environment for local development

1 participant