|
| 1 | +# BUILD_PR_LEVEL_12_5_SERVER_HOSTING_DOCKER_RUNTIME |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Implement a minimal single-node Docker runtime for the authoritative multiplayer server path with repeatable startup/shutdown validation. |
| 5 | + |
| 6 | +## Scope |
| 7 | +Primary target files: |
| 8 | +- `samples/phase-13/1316/server/authoritativeMultiplayerServer.mjs` |
| 9 | +- `samples/phase-13/1316/server/Dockerfile` |
| 10 | +- `samples/phase-13/1316/server/docker-compose.yml` |
| 11 | +- `samples/phase-13/1316/server/README.md` |
| 12 | +- `docs/pr/LEVEL_12_5_SERVER_HOSTING_DOCKER_RUNTIME_CHECKLIST.md` |
| 13 | +- `docs/pr/APPLY_PR_LEVEL_12_5_SERVER_HOSTING_DOCKER_RUNTIME.md` |
| 14 | + |
| 15 | +Allowed nearby reads: |
| 16 | +- `src/engine/network/AuthoritativeServerRuntime.js` |
| 17 | +- `src/engine/network/ClientReplicationApplicationLayer.js` |
| 18 | +- `tests/final/MultiplayerNetworkingStack.test.mjs` |
| 19 | +- `samples/phase-13/1316/server/networkSampleADashboardServer.mjs` |
| 20 | + |
| 21 | +## Required implementation |
| 22 | +- Add one Node server entrypoint that hosts the authoritative runtime in single-node mode. |
| 23 | +- Keep Docker runtime single-node only: |
| 24 | + - one container |
| 25 | + - one exposed service port |
| 26 | + - no orchestration, no horizontal scaling |
| 27 | +- Define env-driven runtime configuration for: |
| 28 | + - bind host |
| 29 | + - service port |
| 30 | + - session id |
| 31 | + - tick rate |
| 32 | + - optional admin/health key contract (if required by existing server pattern) |
| 33 | +- Provide startup/shutdown lifecycle behavior: |
| 34 | + - startup initializes authoritative runtime and begins accepting client/session interaction |
| 35 | + - shutdown stops runtime cleanly and exits without residual state |
| 36 | +- Provide container health/readiness endpoint and document commands. |
| 37 | + |
| 38 | +## Acceptance criteria |
| 39 | +- Containerized server starts in single-node mode. |
| 40 | +- Client can connect to containerized server session path. |
| 41 | +- Session lifecycle is valid through startup, active session, and shutdown. |
| 42 | +- Startup/run/stop instructions are documented and repeatable. |
| 43 | +- Scope remains minimal; no scaling/orchestration features added. |
| 44 | + |
| 45 | +## Validation |
| 46 | +Run only: |
| 47 | +- `node --check samples/phase-13/1316/server/authoritativeMultiplayerServer.mjs` |
| 48 | +- `docker build -f samples/phase-13/1316/server/Dockerfile samples/phase-13/1316 -t authoritative-server-single-node` |
| 49 | +- `docker run --rm -p 4310:4310 authoritative-server-single-node` |
| 50 | +- `docker compose -f samples/phase-13/1316/server/docker-compose.yml up --build` |
| 51 | +- `node --input-type=module -e "import('./tests/final/MultiplayerNetworkingStack.test.mjs').then(async ({ run }) => { await run(); console.log('PASS MultiplayerNetworkingStack'); })"` |
| 52 | + |
| 53 | +## Non-goals |
| 54 | +- no cloud deployment expansion |
| 55 | +- no Kubernetes/orchestration layer |
| 56 | +- no horizontal scaling |
| 57 | +- no gameplay expansion |
| 58 | +- no 3D work |
| 59 | +- no broad debug/tool expansion |
| 60 | + |
| 61 | +## Working tree rule |
| 62 | +If the tree is already dirty, ignore unrelated files and modify only the scoped files for this PR purpose. |
0 commit comments