diff --git a/CLAUDE.md b/CLAUDE.md index 0d879e0..2501c82 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -329,23 +329,18 @@ git checkout -b feat/ # e.g. feat/user-profile-avatar-uploa ``` #### 2 — Spin up an isolated Docker stack for the feature -A dedicated compose stack runs alongside the main dev stack so both can be tested independently. +The feature stack always uses port `5173` (same as the main dev stack). Stop the main stack before starting a feature stack, and restart it when done. -**Find the next free port** (main dev stack owns 5173): +**Stop the main dev stack first:** ```bash -for port in $(seq 5174 5200); do - lsof -iTCP:$port -sTCP:LISTEN -t &>/dev/null || { echo "$port"; break; } -done +docker compose -f docker-compose.yml -f docker-compose.dev.yml down ``` -Use the first free port returned (call it `$PORT`). **Create a per-feature override file** at `docker-compose.feat-.yml` (gitignored): ```yaml # docker-compose.feat-.yml — feature test stack, never committed to main services: frontend: - ports: - - "$PORT:8080" # e.g. 5174:8080 container_name: frontend- backend: container_name: backend- @@ -371,8 +366,7 @@ docker compose -f docker-compose.yml \ --project-name up --build ``` -The feature frontend is now reachable at `http://localhost:$PORT`. -The main dev stack continues running unaffected on `:5173`. +The feature frontend is now reachable at `http://localhost:5173`. #### 3 — Develop on the feature branch All code changes happen on `feat/`. Commit and push normally: @@ -383,7 +377,7 @@ git push -u origin feat/ ``` #### 4 — Confirm functionality -Before merging, verify all of the following on `http://localhost:$PORT`: +Before merging, verify all of the following on `http://localhost:5173`: - [ ] Login and registration work end-to-end - [ ] The specific feature works as intended - [ ] No regressions visible in the UI @@ -400,13 +394,16 @@ git branch -d feat/ git push origin --delete feat/ ``` -#### 6 — Tear down the feature stack +#### 6 — Tear down the feature stack and restart main dev stack ```bash docker compose -f docker-compose.yml \ -f docker-compose.dev.yml \ -f docker-compose.feat-.yml \ --project-name down --volumes --remove-orphans rm docker-compose.feat-.yml + +# Restart the main dev stack on :5173 +docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build -d ``` ---