Files
OSIT-AE-Docker-Env/CHEATSHEET.md
2026-03-26 19:20:52 -04:00

45 lines
2.8 KiB
Markdown

# Aether Docker Cheat Sheet 🚀
## 🚀 Deployment & Updates
- **Full Rebuild:** `docker compose up -d --build`
- **Rebuild SvelteKit only:** `docker compose up -d --build ae_app`
- **Restart API (pick up Python changes):** `docker compose restart ae_api`
- **Rebuild SvelteKit (local):** `make build-docker-dev` / `build-docker-test` / `build-docker-prod`
- **Deploy to remote:** `make deploy-remote-test` / `deploy-remote-prod` (SSH → linode.oneskyit.com)
- **Shut everything down:** `npm run compose:down` (from `aether_app_sveltekit/`)
## 🛠️ Management Links
- **SvelteKit Frontend:** [http://localhost:8888](http://localhost:8888) (LAN HTTP via ae_web_dev)
- **FastAPI Docs:** [https://dev-api.oneskyit.com/docs](https://dev-api.oneskyit.com/docs)
- **Database (phpMyAdmin):** [http://localhost:8081](http://localhost:8081) (requires `--profile database`)
- **Logs (Dozzle):** [http://localhost:8881](http://localhost:8881)
## 🔌 Multi-Stack Port Reference
To run multiple stacks (`test`, `bak`, `prod`) on one host, you **must** assign unique host ports in each `.env`.
| 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 |
## 🏗️ Multi-Stack Isolation
1. **Network Name:** Set `AE_NETWORK_NAME=ae_test_net` (etc) to prevent Docker network name collisions.
2. **Container Names:** All service container names are now `.env` variables with `:-default` fallbacks. Set unique values per stack:
- `CONTAINER_WEB`, `CONTAINER_REDIS`, `CONTAINER_DOZZLE`
- `CONTAINER_MARIADB`, `CONTAINER_PMA`, `CONTAINER_AE_OPS` (database profile only)
- Note: `ae_api` and `ae_app` use `scale` — Docker does not allow `container_name` on scaled services.
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)
- **Manual Restore:** `./restore_db.sh [path_to_file.gz]`
- **Conference Export:** `./export_db.sh` (saves to `backups/conference_export/`)
- **Automated Import:** Drop file in `backups/import/` → run `./check_and_import.sh`
## 🧹 Maintenance
- **Internal Logs:** Docker handles rotation automatically (10MB limit).
- **Dozzle:** Live log viewer at port 8881 — no auth currently (LAN only).