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

@@ -4,7 +4,7 @@ This repository provides the unified Docker orchestration and configuration for
## 🌐 Traffic Architecture
Understanding this prevents configuration mistakes.
The V3 environment uses a **Dual-Network** strategy to support multiple isolated stacks (`test`, `bak`, `prod`) on a single host while sharing core services like MariaDB or Redis.
```
External Internet
@@ -22,23 +22,22 @@ workstation:3001 workstation:5060
ae_app replicas ae_api replicas
```
**Key points:**
- Home server nginx terminates SSL and routes by domain name to one of two stable ports. It never needs to know about replicas.
- `ae_web_dev` is the internal load balancer. It routes by `server_name` to the correct upstream, and Docker DNS automatically round-robins across all replicas.
- SSL is terminated at the home server. Internal traffic (home server → workstation → containers) is plain HTTP — no internal certs needed.
- To scale, change `AE_APP_REPLICAS` or `AE_API_REPLICAS` in `.env` and run `docker compose up -d`. Home server nginx never changes.
**Host ports exposed by ae_web_dev:**
- `:3001` — App gateway (SvelteKit)
- `:5060` — API gateway (FastAPI)
- `:8888` — LAN HTTP (direct local access without going through home server)
- `:443` — commented out; SSL terminates at home server, not internally
**Key Improvements:**
- **Scalable Routing:** Nginx uses Regex (`~^(dev|test|bak|sr|prod)?-?...`) to automatically handle any environment prefix without configuration changes.
- **Isolated Stacks:** Each deployment uses a unique `AE_NETWORK_NAME` and `CONTAINER_` prefix to prevent collisions.
- **Shared Services:** Core infrastructure (DB/Redis) resides on the `aether_shared_net` which must be created manually once.
---
## 🚀 Quick Start
### 1. Initialize Directory Structure
### 1. Initialize Host Network
Before starting your first stack, create the shared internal network:
```bash
docker network create aether_shared_net
```
### 2. Initialize Directory Structure
Create the base directory and clone this environment:
```bash
sudo mkdir -p /srv/env/aether
@@ -46,12 +45,12 @@ sudo chown -R $USER:$USER /srv/env/aether
git clone https://bitbucket.org/oneskyit/one-sky-it-container-environment.git /srv/env/aether/container_env
```
### 2. Configure Environment Settings
Copy the template and update it with your local paths and credentials:
### 3. Configure Environment Settings
Copy the template and update it with your unique stack identifiers:
```bash
cd /srv/env/aether/container_env
cp env.default .env
# Edit .env to match your host system (Paths, DB, Ports)
# CRITICAL: Set unique CONTAINER_ prefixes and AE_NETWORK_NAME for each stack
vim .env
```