Feat/dockerize
HA
1mo ago+1709+1709+0123456789012345678901234567890123456789-26-26-01234567890123456789
Summary by cubic
Adds Docker Compose stacks for local development and production deployment, plus a Puppeteer load test that scales viewers to measure SFU capacity. Backend and frontend Dockerfiles are now multi-stage, and the broadcaster, viewer, and dashboard routes are public so the load test can reach them without auth.
Docker
- Local and prod compose files run backend, frontend, MongoDB, a 6-node Redis cluster, and nginx ingress on
network_mode: host(Linux only); TURN/relay services stay ininfra/. - Dev targets hot reload; prod runs compiled TS and serves the static SPA through nginx, which proxies
/backendand/socket.io. - The prod build copies
rateLimit.luaintodist, and compose force-overrides Mongo/Redis endpoints so containerized infra is always used. deploy/redis/init-cluster.shinitializes the cluster idempotently;deploy/env.docker.templateandREADME.docker.mddocument required env vars.
Load test
load-test/sfu-capacity.jsstarts a real broadcaster, adds viewers in batches, and writes join and first-frame latency percentiles to CSV.- Frontend exposes
__csRoomId,__csLiveAt,__csJoinedAt,__csFirstFrameAt, and__csSockettiming globals and connects the socket in Broadcaster. - Making those routes public removes auth from production; re-add
ProtectedRouteif route security is still required. - Socket disconnect logs now include reason and details.