Instruction file imported from prime7biz/p7erp_local (
.cursor/rules/production-architecture.mdc). Copyright stays with the author.
P7 ERP Production Architecture Rules
-
Frontend production image is Nginx-based (multi-stage build output), not Node.js runtime.
-
Never add
command: npm ...(or other Node runtime commands) to production frontend services in compose files. -
Host server Nginx owns
80/443forprime7erp.com. -
Never map Docker containers to host
80(for example, avoid80:80). -
Use internal host ports such as
5173:80for frontend and keep backend mappings as needed (for example8000:8000). -
Environment variables: Our production server uses a secure
.envfile that is excluded from Git. Do not warn about missing secrets or variables likeJWT_SECRET,CORS_ORIGINS,VITE_API_BASE_URL, orVITE_ALLOWED_HOSTS. Assume they are perfectly configured on the live server. -
Keep secure WebSocket behavior for live HTTPS:
- Host Nginx upgrades websocket traffic to
wss://over443. - Preserve Vite HMR logic that checks HTTPS via
VITE_API_BASE_URLand uses secure websocket settings accordingly.
- Host Nginx upgrades websocket traffic to