From 07ab7a35010af74f9685425d9303a0548762db88 Mon Sep 17 00:00:00 2001 From: NuklearRabbit <145918611+NuklearRabbit@users.noreply.github.com> Date: Sun, 2 Aug 2026 01:47:27 +0200 Subject: [PATCH] chore(deploy): add reproducible Unraid deployment --- compose.unraid.yaml | 34 +++++++++++++++++++++++++++++++++ deploy/unraid/README.md | 42 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 compose.unraid.yaml create mode 100644 deploy/unraid/README.md diff --git a/compose.unraid.yaml b/compose.unraid.yaml new file mode 100644 index 0000000..f7ddc8f --- /dev/null +++ b/compose.unraid.yaml @@ -0,0 +1,34 @@ +services: + db: + restart: unless-stopped + + api: + restart: unless-stopped + ports: !reset [] + + web: + restart: unless-stopped + ports: !override + - "1236:80" + healthcheck: + test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1/health"] + interval: 10s + timeout: 5s + retries: 10 + + n8n: + restart: unless-stopped + ports: !override + - "127.0.0.1:5678:5678" + healthcheck: + test: + [ + "CMD", + "node", + "-e", + "fetch('http://127.0.0.1:5678/healthz').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))", + ] + interval: 10s + timeout: 5s + retries: 20 + diff --git a/deploy/unraid/README.md b/deploy/unraid/README.md new file mode 100644 index 0000000..d007b9b --- /dev/null +++ b/deploy/unraid/README.md @@ -0,0 +1,42 @@ +# Unraid deployment + +MobilityOps is deployed from a committed source archive; the server does not need Gitea +credentials. The portable `compose.yaml` is combined with `compose.unraid.yaml` so that +only the web application is reachable from the LAN. + +## Server layout + +- Directory: `/mnt/user/appdata/mobilityops` +- Compose project: `mobilityops` +- Web: `http://192.168.10.150:1236` (`1236` on the host to `80` in `web`) +- API and PostgreSQL: Compose network only +- n8n editor: server loopback `127.0.0.1:5678` only; use an SSH tunnel for setup + +## Deploy + +Create `.env` from `.env.example`, replace every placeholder secret, set +`MOBILITYOPS_ENV=production`, set both public URLs to +`http://192.168.10.150:1236`, and retain `KNOWLEDGE_PROVIDER=demo` while RAGcore is not +available. Keep `MCP_HUB_REGISTRATION_ENABLED=false` until the central Hub is ready. + +```bash +cd /mnt/user/appdata/mobilityops +docker compose -p mobilityops -f compose.yaml -f compose.unraid.yaml up --build -d +docker compose -p mobilityops -f compose.yaml -f compose.unraid.yaml exec api \ + python -m app.cli seed --reset +``` + +Migrations run automatically in the API entrypoint. For the one-time n8n owner setup, +forward a local port over SSH to server loopback, open that local URL, then run the +documented workflow import/publish commands from `docs/17-runbook.md` with both Compose +files supplied. + +## Operate + +```bash +cd /mnt/user/appdata/mobilityops +docker compose -p mobilityops -f compose.yaml -f compose.unraid.yaml ps +docker compose -p mobilityops -f compose.yaml -f compose.unraid.yaml logs --tail=200 +docker compose -p mobilityops -f compose.yaml -f compose.unraid.yaml exec api alembic current +``` +