Skip to content

fix(dev): make multi-instance commands and proxy routing instance-aware#284

Merged
LuD1161 merged 1 commit intomainfrom
ENG-189-fix-multi-instance-dev-stack
Feb 13, 2026
Merged

fix(dev): make multi-instance commands and proxy routing instance-aware#284
LuD1161 merged 1 commit intomainfrom
ENG-189-fix-multi-instance-dev-stack

Conversation

@LuD1161
Copy link
Contributor

@LuD1161 LuD1161 commented Feb 12, 2026

Summary

  • Fix Vite proxy hardcoded to instance 0's backend — now reads VITE_API_URL from env
  • Fix justfile commands hardcoded to instance 0 — dynamic instance resolution from SHIPSEC_INSTANCE env / .shipsec-instance file / default 0
  • Re-add VITE_API_URL to PM2 config with instance-aware port (removed by PR fix(pm2): use instance-aware env for frontend VITE_API_URL #280 but still needed by Vite proxy)
  • Document nginx instance 0 limitation in nginx.dev.conf
  • Add missing dev-ports Docker Compose overlay to dev:infra / dev:stack:stop scripts
  • Add --force to backend migration:push for instance databases
  • Fix ESLint config to use projectService for project references (unblocks linting vite.config.ts)
  • Simplify MULTI-INSTANCE-DEV.md to match actual working commands

Test plan

  • just dev starts instance 0 as before (no regression)
  • SHIPSEC_INSTANCE=1 just dev starts instance 1 on ports 5273/3311
  • Instance 1 frontend proxies /api to port 3311 (not 3211)
  • SHIPSEC_INSTANCE=1 just dev stop stops only instance 1 PM2 apps, leaves infra running
  • just dev stop (instance 0) tears down infra
  • SHIPSEC_INSTANCE=1 just dev logs shows only instance 1 logs

The dev stack had several issues that prevented non-zero instances from
working correctly:

1. Vite proxy hardcoded to instance 0's backend (localhost:3211)
2. Justfile commands hardcoded to instance 0 PM2 app names
3. PM2 missing VITE_API_URL after PR #280 removal
4. Nginx had no docs about its instance 0 limitation
5. dev:infra script missing dev-ports Docker Compose overlay
6. Backend migration push failing on instance databases

- Make vite.config.ts read VITE_API_URL from env for proxy target
- Add instance resolution to justfile (env → .shipsec-instance → 0)
- Make stop/clean only tear down infra for instance 0
- Filter logs to the active instance's PM2 apps
- Re-add VITE_API_URL to PM2 config with instance-aware port
- Document nginx instance 0 limitation in nginx.dev.conf
- Add dev-ports overlay to dev:infra and dev:stack:stop scripts
- Add --force to backend migration:push for instance databases
- Simplify MULTI-INSTANCE-DEV.md to match actual working commands
- Fix ESLint config to use projectService for project references

Signed-off-by: Aseem Shrey <LuD1161@users.noreply.github.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@LuD1161 LuD1161 merged commit 280752f into main Feb 13, 2026
3 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.

1 participant