docs: updated README and CHEATSHEET with multi-stack and shared network architecture.

This commit is contained in:
Scott Idem
2026-03-12 02:28:43 -04:00
parent 0072a16c25
commit f636c021bc
2 changed files with 28 additions and 30 deletions

View File

@@ -13,22 +13,21 @@
- **Database (phpMyAdmin):** [http://localhost:8081](http://localhost:8081) (requires `--profile database`)
- **Logs (Dozzle):** [http://localhost:8881](http://localhost:8881)
## 🔌 Port Reference
| Port | Variable | Purpose |
|------|-----------------------|--------------------------------------------------|
| 3001 | `AE_APP_GATEWAY_PORT` | App gateway — home nginx → ae_app replicas |
| 5060 | `AE_API_GATEWAY_PORT` | API gateway — home nginx → ae_api replicas |
| 8888 | `OSIT_WEB_HTTP_PORT` | LAN HTTP direct access (no home server needed) |
| 8081 | `AE_PMA_PORT` | phpMyAdmin (database profile only) |
| 8881 | — | Dozzle log viewer |
| 3306 | `AE_DB_EXTERNAL_PORT` | MariaDB direct (database profile only) |
## 🔌 Multi-Stack Port Reference
To run multiple stacks (`test`, `bak`, `prod`) on one host, you **must** assign unique host ports in each `.env`.
## 📈 Scaling
Both services scale via Docker DNS round-robin inside `ae_web_dev`.
Home server nginx **never needs to change** — it always points to the same port.
| Port Type | Variable | Example (Test) | Example (Bak) | Example (Prod) |
|-----------------|-----------------------|----------------|---------------|----------------|
| App Gateway | `AE_APP_GATEWAY_PORT` | 3009 | 3002 | 3001 |
| API Gateway | `AE_API_GATEWAY_PORT` | 5063 | 5062 | 5061 |
| LAN Direct HTTP | `OSIT_WEB_HTTP_PORT` | 32887 | 32891 | 32890 |
| Dozzle Logs | `AE_DOZZLE_PORT` | 8889 | 8882 | 8881 |
| MariaDB Direct | `AE_DB_EXTERNAL_PORT` | 32769 | 32770 | 32768 |
- Edit `.env``AE_APP_REPLICAS=X` or `AE_API_REPLICAS=X`
- Run `docker compose up -d` (or `up -d ae_app` for app-only)
## 🏗️ Multi-Stack Isolation
1. **Network Name:** Set `AE_NETWORK_NAME=ae_test_net` (etc) to prevent Docker network name collisions.
2. **Container Names:** Set `CONTAINER_` variables (e.g., `CONTAINER_WEB=ae_web_test`) to prevent Docker from refusing to start "conflicting" containers.
3. **Internal Shared Net:** All stacks must connect to `aether_shared_net` to reach a shared MariaDB/Redis.
## 💾 Database Operations
- **Manual Backup:** `./backup_db.sh` (hot backup, live container)