Files
svelte-mud/DOCKER-README.md
T

56 lines
1.6 KiB
Markdown
Raw Normal View History

2026-09-09 13:04:56 +02:00
# Docker deployment
2025-04-21 14:12:36 +02:00
2026-09-09 13:04:56 +02:00
The Compose deployment uses two containers made from the same image:
2025-04-21 14:12:36 +02:00
2026-09-09 13:04:56 +02:00
- `svelte-mud-app` runs the adapter-node SvelteKit build on port 3000.
- `svelte-mud-proxy` runs the WebSocket-to-Telnet proxy on port 3001.
2025-04-21 23:22:32 +02:00
2026-09-09 13:04:56 +02:00
Neither port is published to the host. Both services join the external `revproxy` network for access by Caddy.
2025-04-21 23:22:32 +02:00
2026-09-09 13:04:56 +02:00
## Deploy
2025-04-21 14:12:36 +02:00
2026-09-09 13:04:56 +02:00
1. Change `mud.iamtalon.me` in `docker-compose.yml` and `Caddyfile` to the actual public hostname.
2. Create the proxy network if it does not already exist:
2025-04-21 14:12:36 +02:00
```bash
2026-09-09 13:04:56 +02:00
docker network create revproxy
2025-04-21 14:12:36 +02:00
```
2026-09-09 13:04:56 +02:00
3. Build and start both services:
2025-04-21 14:12:36 +02:00
```bash
2026-09-09 13:04:56 +02:00
docker compose up --build -d
2025-04-21 14:12:36 +02:00
```
2026-09-09 13:04:56 +02:00
4. Inspect health and logs:
2025-04-21 14:12:36 +02:00
2026-09-09 13:04:56 +02:00
```bash
docker compose ps
docker compose logs -f
```
2025-04-21 14:12:36 +02:00
2026-09-09 13:04:56 +02:00
Stop the deployment with `docker compose down`.
## Reverse proxy
The included `Caddyfile` sends `/mud-ws` to `svelte-mud-proxy:3001` and other requests to `svelte-mud-app:3000`. It also installs a restrictive content security policy and related browser security headers.
`TRUST_PROXY=1` must only be used when clients cannot reach the proxy container directly and the forwarding proxy overwrites `X-Forwarded-For`. Otherwise remove it so connection quotas use the actual socket address.
`ALLOWED_ORIGINS` is an exact, comma-separated allowlist. For example:
```yaml
ALLOWED_ORIGINS: https://mud.example.com
```
Do not publish port 3001 publicly. Origin checks are a browser boundary, not an authentication mechanism.
## Updating
2025-04-21 14:12:36 +02:00
```bash
2026-09-09 13:04:56 +02:00
docker compose build --pull
docker compose up -d
2025-04-21 14:12:36 +02:00
```
2026-09-09 13:04:56 +02:00
The containers run as an unprivileged user and include independent health checks for the web app and proxy.