| 1 | # Deploying Market Atlas on MacLustr |
1 | # Deploying Market Atlas on MacLustr |
| 2 | |
2 | |
| 3 | −Production runs on **M2U64** (Mac Studio M2 Ultra, 24 c / 64 GB) behind the MacLustr Tunnel (BHS64 Caddy → WireGuard wg1 10.67.0.12). |
3 | +> **Since 2026-09-13 production runs on the OVH server BHS128** (`ssh BHS128`, ubuntu@51.161.112.69, Ubuntu 24.04, 12 threads / 128 GB), |
| |
4 | +> outside `mld`: code in `~/apps/market-atlas`, Postgres 17 native (db/role `market_atlas`, en_US.UTF-8), data in `~/market-atlas-data`, |
| |
5 | +> PM2 under systemd (`pm2-ubuntu`, `LimitNOFILE` 1 048 576) with `~/apps/pm2.market-atlas.config.cjs` generated from the mld manifest by |
| |
6 | +> `~/apps/.manifests/gen-pm2.py` (secrets, 0600). Tunnel route: `mlt add www.market-atlas.co BHS128:8380 --websocket` (BHS64 Caddy → wg1 10.67.0.60). |
| |
7 | +> Firewall: `ufw allow in on wg1 from 10.67.0.1 to any port 8380 proto tcp`. The apps were moved because the LAN uplink (Bell) could not |
| |
8 | +> sustain the cluster's outbound connection count. **Release on BHS128**: `rsync -az --exclude node_modules --exclude .git --exclude 'apps/web/.next' --exclude 'apps/api/dist' --exclude data . BHS128:apps/market-atlas/` |
| |
9 | +> then `ssh BHS128 'cd apps/market-atlas && pnpm install --frozen-lockfile && pnpm --filter @market-atlas/api build && (cd apps/web && API_URL=http://127.0.0.1:8380 NEXT_PUBLIC_SITE_URL=https://www.market-atlas.co pnpm build) && pm2 restart market-atlas-core market-atlas-web && pm2 save'`. |
| |
10 | +> pnpm ≥ 10 needs `onlyBuiltDependencies` (esbuild) in `pnpm-workspace.yaml`, otherwise `ERR_PNPM_IGNORED_BUILDS` on a fresh install. |
| |
11 | +> The M2U64 copy (`~/apps/market-atlas`, Postgres `market_atlas`) is kept as a cold backup; the `mld` procedure below still works to move back. |
| |
12 | + |
| |
13 | +Production formerly ran on **M2U64** (Mac Studio M2 Ultra, 24 c / 64 GB) behind the MacLustr Tunnel (BHS64 Caddy → WireGuard wg1 10.67.0.12). |
| 4 | Everything goes through the gateway M1M32 and `mld` (`~/Desktop/cluster-skill/mld`). |
14 | Everything goes through the gateway M1M32 and `mld` (`~/Desktop/cluster-skill/mld`). |
| 5 | |
15 | |
| 6 | ``` |
16 | ``` |