From bd5759f037a27da5e8bc4fdbdc535c21b864255d Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 26 Mar 2026 18:05:18 -0400 Subject: [PATCH] docs(readme): update build/deploy section for new script names and env tiers Replace stale deploy:staging/deploy:prod references with current build:docker:*, deploy:remote:*, and .env.dev/test/prod file names. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 62 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 084d12e5..5cbce62f 100644 --- a/README.md +++ b/README.md @@ -123,32 +123,45 @@ Developer sandbox pages — not for production use. # How to build and deploy SvelteKit: -The deployment is now fully integrated into the unified **Aether Docker Environment** (`aether_container_env`). The application is built directly from source inside a clean Docker container, ensuring consistent environment handling across staging and production. +The deployment is fully integrated into the unified **Aether Docker Environment** (`aether_container_env`). The application is built inside a clean Docker container using `vite build --mode `, which reads the corresponding `.env.` file for `PUBLIC_` variables. -### Deployment Commands +## Environments -Run these commands from the root of the `aether_app_sveltekit` project: +| Environment | Env file | Vite mode | API server | +| ----------- | ----------- | --------- | ------------------------- | +| dev | `.env.dev` | `dev` | `dev-api.oneskyit.com` | +| test | `.env.test` | `test` | `test-api.oneskyit.com` | +| prod | `.env.prod` | `prod` | `api.oneskyit.com` | + +## Commands (from `aether_app_sveltekit/`) -#### 1. Deploy to Staging (Dev Workstation) -This triggers an autonomous build inside the Docker container using your `.env.staging` file and restarts the service. ```bash -npm run deploy:staging -``` +# Active development — Vite HMR, no Docker +npm run dev -#### 2. Deploy to Production -This builds the image using production flags (using `.env.prod`) and restarts the production container. -```bash -npm run deploy:prod +# Build Vite output only (no Docker) +npm run build:dev +npm run build:test +npm run build:prod + +# Build Docker image and restart container locally +npm run build:docker:dev +npm run build:docker:test +npm run build:docker:prod + +# Deploy to remote server (SSH → linode.oneskyit.com → deploy.sh) +npm run deploy:remote:test +npm run deploy:remote:prod ``` ### Technical Details - **Unified Orchestration**: All services (API, UI, Redis) are managed via `~/OSIT_dev/aether_container_env/docker-compose.yml`. -- **Dockerfile**: Uses a multi-stage build. Stage 1 (builder) installs dependencies and builds the app using the `BUILD_MODE` argument passed from Docker Compose. Stage 2 (runtime) creates the final lightweight image. +- **Dockerfile**: Multi-stage build. Stage 1 (builder) runs `vite build --mode $BUILD_MODE` using `.env.$BUILD_MODE`. Stage 2 (runtime) creates the final lightweight Node image. - **Environment Handling**: - - `PUBLIC_` variables are baked into the image during the build step. - - Private runtime variables are passed via the orchestration's `.env` file. -- **Networking**: The frontend communicates with the backend via the high-speed internal Docker network (`http://ae_api:5005`). + - `PUBLIC_` variables are baked into the image at build time via the `.env.` file. + - Private runtime variables are passed via the Docker Compose `.env` file in `aether_container_env/`. +- **Remote deploy**: `aether_container_env/deploy.sh` handles git pull + Docker build + restart on the server. Triggered via `npm run deploy:remote:*`. --- @@ -229,8 +242,9 @@ npm install @tiptap/extension-link @tiptap/extension-bullet-list @tiptap/extensi The application uses standard SvelteKit `.env` files for build-time configuration (specifically for `PUBLIC_` prefixed variables). -- **`.env.staging`**: Used by `npm run deploy:staging`. -- **`.env.prod`**: Used by `npm run deploy:prod`. +- **`.env.dev`**: Used by `npm run build:docker:dev` and `npm run build:dev`. +- **`.env.test`**: Used by `npm run build:docker:test` and `npm run build:test`. +- **`.env.prod`**: Used by `npm run build:docker:prod` and `npm run build:prod`. - **`.env.local`**: Used during local development (`npm run dev`). **Note:** Runtime variables (like private API keys or DB credentials) are managed in the deployment directory's `.env` file and passed to the containers via Docker Compose. @@ -248,16 +262,16 @@ npm run dev npm run dev -- --open ``` -## Deployment (Production/Staging) - -To create a production or staging version and deploy it to the local containers: +## Deployment ```bash -# For Staging/Dev -npm run deploy:staging +# Build Docker image locally and restart container +npm run build:docker:dev +npm run build:docker:prod -# For Production -npm run deploy:prod +# Deploy to remote server (linode.oneskyit.com) +npm run deploy:remote:test +npm run deploy:remote:prod ``` These commands use the multi-stage **Dockerfile** to build the app in a clean environment and automatically restart the corresponding Docker containers.