docs: Update for unified SvelteKit + FastAPI architecture. Added autonomous SvelteKit build process and updated cheatsheet commands.
This commit is contained in:
@@ -1,26 +1,25 @@
|
||||
# Aether Docker Cheat Sheet 🚀
|
||||
|
||||
## 🚀 Deployment & Updates
|
||||
- **Full Rebuild (Fast):** `docker compose up -d --build`
|
||||
- **Rebuild SvelteKit UI:** `docker compose up -d --build ae_app`
|
||||
- **Restart API (Pick up Python changes):** `docker compose restart ae_api`
|
||||
- **Switch Build Mode:** Edit `.env` -> `AE_APP_BUILD_MODE=prod` -> `docker compose up -d --build ae_app`
|
||||
|
||||
## 🛠️ Management Links
|
||||
- **Dashboard:** [http://localhost:8888](http://localhost:8888)
|
||||
- **Logs (Dozzle):** [http://localhost:8881](http://localhost:8881)
|
||||
- **SvelteKit Frontend:** [http://localhost:3001](http://localhost:3001)
|
||||
- **FastAPI Documentation:** [https://dev-api.oneskyit.com/docs](https://dev-api.oneskyit.com/docs)
|
||||
- **Database (phpMyAdmin):** [http://localhost:8081](http://localhost:8081)
|
||||
- **API Docs:** [https://dev-api.oneskyit.com/docs](https://dev-api.oneskyit.com/docs)
|
||||
- **Logs (Dozzle):** [http://localhost:8881](http://localhost:8881)
|
||||
|
||||
## 💾 Database Operations
|
||||
- **Manual Backup:** `./backup_db.sh` (Hot backup, live container)
|
||||
- **Manual Restore:** `./restore_db.sh [path_to_file.gz]` (Automated password/grant reset)
|
||||
- **Conference Export:** `./export_db.sh` (Saves to `backups/conference_export/`)
|
||||
- **Automated Onsite Import:**
|
||||
1. Drop a backup into `backups/import/`.
|
||||
2. Run `./check_and_import.sh`.
|
||||
3. The file will be restored and moved to `backups/imported/`.
|
||||
- **Automated Import:** Drop file in `backups/import/` -> Run `./check_and_import.sh`.
|
||||
|
||||
## ⏰ Scheduling
|
||||
To backup every hour at 55 minutes past:
|
||||
`55 * * * * /home/scott/OSIT_dev/aether_container_env/backup_db.sh`
|
||||
|
||||
## 📈 Scaling the API
|
||||
1. Edit `.env` -> `AE_API_REPLICAS=X`
|
||||
## 📈 Scaling
|
||||
1. Edit `.env` -> `AE_API_REPLICAS=X` (or `AE_APP_REPLICAS=X`)
|
||||
2. Run `docker compose up -d`
|
||||
|
||||
## 🧹 Maintenance
|
||||
|
||||
35
README.md
35
README.md
@@ -1,6 +1,6 @@
|
||||
# Aether Framework - Docker Environment
|
||||
# Aether Framework - Docker Environment (Unified V3)
|
||||
|
||||
This repository provides the Docker orchestration and configuration for the Aether Platform. It manages the lifecycle of the Aether API (FastAPI), Aether App (SvelteKit/Flask), and supporting infrastructure (MariaDB, Redis, Nginx).
|
||||
This repository provides the unified Docker orchestration and configuration for the Aether Platform. It manages the lifecycle of the Aether API (FastAPI), Aether App (SvelteKit), and supporting infrastructure (MariaDB, Redis, Nginx).
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
@@ -17,18 +17,16 @@ Copy the template and update it with your local paths and credentials:
|
||||
```bash
|
||||
cd /srv/env/aether/container_env
|
||||
cp env.default .env
|
||||
# Edit .env to match your host system
|
||||
# Edit .env to match your host system (Paths, DB, Ports)
|
||||
vim .env
|
||||
```
|
||||
|
||||
### 3. Setup Persistent Data & Symlinks
|
||||
The containers expect data and source code to be available in the `srv/` directory via symlinks:
|
||||
The containers expect data and some source code to be available via absolute paths defined in `.env`:
|
||||
- **FastAPI Source (`AE_API_SRC`):** Mounted directly for real-time development.
|
||||
- **SvelteKit Source (`AE_APP_SRC`):** Used as the build context for the SvelteKit container.
|
||||
- **Hosted Files:** Link physical file storage for the API:
|
||||
```bash
|
||||
# Link your local source code
|
||||
ln -s ~/OSIT_dev/aether_api_fastapi srv/aether_api
|
||||
ln -s ~/OSIT_dev/aether_app_sveltekit srv/aether_app
|
||||
|
||||
# Link physical file storage
|
||||
ln -s /mnt/data/aether/hosted_files srv/hosted_files
|
||||
ln -s /mnt/data/aether/hosted_tmp srv/hosted_tmp
|
||||
```
|
||||
@@ -41,23 +39,28 @@ ln -s /mnt/data/aether/hosted_tmp srv/hosted_tmp
|
||||
|
||||
## 🛠️ Management Commands
|
||||
|
||||
### Orchestration
|
||||
### Orchestration (Unified Stack)
|
||||
```bash
|
||||
docker compose up -d # Start all services
|
||||
docker compose up -d --build # Build and start all services (Autonomous SvelteKit build)
|
||||
docker compose down # Stop all services
|
||||
docker compose restart ae_api # Restart specific service
|
||||
docker compose restart ae_app # Restart the SvelteKit UI
|
||||
docker compose restart ae_api # Restart the FastAPI Backend
|
||||
```
|
||||
|
||||
### Branch Management
|
||||
### Deployment Workflow
|
||||
The SvelteKit application is built **inside** the container. You can control the build mode (which bakes in the correct `PUBLIC_` variables) via the `.env` file:
|
||||
- Set `AE_APP_BUILD_MODE=staging` for development/testing.
|
||||
- Set `AE_APP_BUILD_MODE=prod` for production.
|
||||
|
||||
Then run:
|
||||
```bash
|
||||
git pull --all
|
||||
git switch development
|
||||
docker compose up -d --build
|
||||
docker compose up -d --build ae_app
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🗄️ Database Management (Physical Backups)
|
||||
... (rest of the file remains the same) ...
|
||||
|
||||
The system uses physical hot backups via `mariabackup` for maximum speed and data integrity.
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ services:
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=US/Eastern
|
||||
|
||||
- NGINX_SERVER_NAMES="flask_gunicorn.localhost demo.localhost dev.localhost dev.oneskyit.com dev-app.oneskyit.com dev-connect.oneskyit.com dev-demo.oneskyit.com dev-aacc.oneskyit.com dev-aapor.oneskyit.com dev-ascm.oneskyit.com dev-businessgroup.oneskyt.com dev-chow.oneskyit.com dev-cmsc.oneskyit.com dev-idaa.oneskyit.com dev-ishlt.oneskyit.com dev-lci.oneskyit.com dev-ncsd.oneskyit.com dev-npa.oneskyit.com dev-rli.oneskyit.com test-app.oneskyit.com"
|
||||
ports:
|
||||
- "${OSIT_WEB_HTTP_PORT}:80"
|
||||
@@ -23,6 +25,7 @@ services:
|
||||
- ./conf/nginx/options-ssl-nginx.conf:/etc/nginx/options-ssl-nginx.conf
|
||||
- ./conf/nginx/site.conf:/etc/nginx/conf.d/0_site.conf
|
||||
- ./conf/nginx/site-enabled_aether_fastapi_gunicorn.conf:/etc/nginx/templates/site-enabled_aether_fastapi_gunicorn.conf.template
|
||||
- ./conf/nginx/site-enabled_aether_app_svelte_node.conf:/etc/nginx/templates/site-enabled_aether_app_svelte_node.conf.template
|
||||
# - ./conf/nginx/site-enabled_aether_flask_gunicorn.conf:/etc/nginx/templates/site-enabled_aether_flask_gunicorn.conf.template
|
||||
- ./conf/certs/oneskyit_wild_fullchain.pem:/etc/certs/fullchain_wild.pem
|
||||
- ./conf/certs/oneskyit_wild_privkey.pem:/etc/certs/privkey_wild.pem
|
||||
@@ -107,12 +110,12 @@ services:
|
||||
env_file:
|
||||
- ./.env
|
||||
extra_hosts:
|
||||
- "${DOCKER_AE_SERVER_EXTRA_HOST}"
|
||||
- "${DOCKER_AE_APP_SERVER_EXTRA_HOST}"
|
||||
- "${DOCKER_AE_API_SERVER_EXTRA_HOST}"
|
||||
- "${DOCKER_AE_API_BAK_SERVER_EXTRA_HOST}"
|
||||
- "${DOCKER_AE_DB_SERVER_EXTRA_HOST}"
|
||||
- "linode.oneskyit.com:104.237.143.4"
|
||||
dev.oneskyit.com: "192.168.32.7"
|
||||
dev-app.oneskyit.com: "192.168.32.7"
|
||||
dev-api.oneskyit.com: "192.168.32.7"
|
||||
test-api.oneskyit.com: "104.237.143.4"
|
||||
vpn-db.oneskyit.com: "192.168.64.5"
|
||||
linode.oneskyit.com: "104.237.143.4"
|
||||
volumes:
|
||||
- ./conf/aether_fastapi_gunicorn_conf.py:/conf/gunicorn_fastapi_conf.py
|
||||
- ./conf/aether_fastapi_requirements_current.txt:/requirements_current.txt
|
||||
@@ -132,6 +135,43 @@ services:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
ae_app:
|
||||
restart: always
|
||||
build:
|
||||
context: ${AE_APP_SRC}
|
||||
dockerfile: Dockerfile
|
||||
target: deploy-node
|
||||
args:
|
||||
BUILD_MODE: ${AE_APP_BUILD_MODE:-staging}
|
||||
scale: 1
|
||||
env_file:
|
||||
- ./.env
|
||||
ports:
|
||||
- "${AE_APP_NODE_PORT}:3000"
|
||||
extra_hosts:
|
||||
srv-nyx.oneskyit.com: "104.237.143.4"
|
||||
dev-app.oneskyit.com: "104.237.143.4"
|
||||
api.oneskyit.com: "104.237.143.4"
|
||||
bak-api.oneskyit.com: "104.237.143.4"
|
||||
test-api.oneskyit.com: "104.237.143.4"
|
||||
dev-api.oneskyit.com: "192.168.32.7"
|
||||
home.oneskyit.com: "71.126.159.102"
|
||||
static.oneskyit.com: "104.237.143.4"
|
||||
dev.oneskyit.com: "192.168.32.7"
|
||||
# volumes:
|
||||
# # In production, the build happens INSIDE the container.
|
||||
# # Mounting the host source here would override the internal build.
|
||||
# # - ${AE_APP_SRC}:/app
|
||||
depends_on:
|
||||
- ae_api
|
||||
- redis
|
||||
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
# *Legacy* Aether Flask Application served with Gunicorn
|
||||
# *NOTE:* This legacy frontend using Flask is being replaced by the new one using SvelteKit.
|
||||
# aether_app_gunicorn:
|
||||
|
||||
23
env.default
23
env.default
@@ -115,6 +115,14 @@ AE_API_JWT_KEY="your-22-char-secret-key"
|
||||
# Regex for allowed CORS origins
|
||||
AE_API_ORIGINS_REGEX="(https://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)"
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# APP SETTINGS (SvelteKit)
|
||||
# ------------------------------------------------------------------------------
|
||||
AE_APP_ENV=development
|
||||
AE_APP_BUILD_MODE=staging
|
||||
AE_APP_REPLICAS=1
|
||||
AE_APP_NODE_PORT=3001
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# SMTP SETTINGS (Email)
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -125,13 +133,13 @@ AE_SMTP_USERNAME=send_mail
|
||||
AE_SMTP_PASSWORD="your-smtp-password-here"
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# APP SETTINGS (Legacy Flask)
|
||||
# LEGACY APP SETTINGS (Flask)
|
||||
# ------------------------------------------------------------------------------
|
||||
AE_APP_ENV=development
|
||||
AE_APP_GUNICORN_PORT=5055
|
||||
AE_APP_CACHE_SECRET_KEY="your-secret-key"
|
||||
AE_APP_SESSION_LIFETIME=86400
|
||||
AE_APP_CACHE_TIMEOUT=5
|
||||
AE_FLASK_APP_ENV=development
|
||||
AE_FLASK_APP_GUNICORN_PORT=5055
|
||||
AE_FLASK_APP_CACHE_SECRET_KEY="your-secret-key"
|
||||
AE_FLASK_APP_SESSION_LIFETIME=86400
|
||||
AE_FLASK_APP_CACHE_TIMEOUT=5
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# SOURCE PATHS (Absolute paths on Host Machine)
|
||||
@@ -141,7 +149,8 @@ AE_APP_CACHE_TIMEOUT=5
|
||||
|
||||
# Project Source Code
|
||||
AE_API_SRC=/path/to/aether_api_fastapi
|
||||
AE_APP_SRC=/path/to/aether_app_flask
|
||||
AE_APP_SRC=/path/to/aether_app_sveltekit
|
||||
AE_FLASK_APP_SRC=/path/to/aether_app_flask
|
||||
|
||||
# Physical File Storage (Images, Documents, etc.)
|
||||
# NOTE: Shared between environments to ensure binary availability
|
||||
|
||||
Reference in New Issue
Block a user