Splitting the server and web across hosts
By default Mokosh Server and Mokosh Web run together on a single host. For larger deployments you can run them on separate hosts.
The two pieces
- Mokosh Server (
mokosh-server) - the API backend plus its PostgreSQL database. This is the stateful core. - Mokosh Web (
mokosh-www) - the browser frontend. It is stateless and talks to the server over its REST API.
Splitting them
Run each on its own host with its own Compose file:
- On the backend host: the
serverandpostgresservices, as in Running with Docker Compose. Expose the API to the frontend host, directly or behind a reverse proxy. - On the frontend host: the
mokosh-wwwcontainer, pointed at the backend host's API URL.
The frontend must reach the server's API, and both sign users in through the same Bunyip issuer, so the server's OIDC_ISSUER / OIDC_AUDIENCE and the web's API target have to line up across the two hosts.