From a32c275f769b9f18e9224ba6e2d24f2849e28297 Mon Sep 17 00:00:00 2001 From: "n.siegfried" Date: Tue, 16 Jun 2026 09:27:38 -0700 Subject: [PATCH] Rewrite DEPLOYMENT.md for the SQL-backed Docker deployment Replaces the stale non-Docker/systemd guide with an admin-facing, start-to- finish guide for the actual stack (nginx serving html/, FastAPI api, Postgres db). Covers prerequisites (external proxy network), the root .env credentials, reverse-proxy wiring, bring-up, and verification. Adds the current data model (projects + project_id/parent_id/issued_at columns), the full endpoint list, a "what's stored in SQL today vs Phase 2" table, backups, and the schema-migration caveat (create_all adds tables, not columns). Points to server/README.md for the deep container reference. Co-Authored-By: Claude Opus 4.8 (1M context) --- DEPLOYMENT.md | 222 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 165 insertions(+), 57 deletions(-) diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 3ac9464..e5e71c6 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -1,81 +1,189 @@ # Deployment -The Work Package Suite has two parts: +Audience: the IT admin standing this up inside the firewall. This covers the +**SQL-backed deployment** — NGINX serving the static front end and a Python API +backed by **PostgreSQL**. -- a **static front end** (plain HTML/CSS/JS — no build step), and -- a **Python API** (FastAPI) backed by **PostgreSQL**, which stores the project - SOPs, Work Packages, and comments so they are shared across users instead of - living in each person's browser. +The repo already contains everything needed to run it as a Docker stack: +`Dockerfile`, `docker-compose.yml`, the `nginx/` config, the front end in +`html/`, and the API in `server/`. The detailed container reference (endpoints, +password rotation, day-to-day commands) lives in +[`server/README.md`](server/README.md) — this doc is the start-to-finish guide. ``` -browser → NGINX ──serves──> static site (index.html, …) - └─proxy /api/─> Python API (uvicorn/gunicorn :8000) → PostgreSQL + [ your TLS reverse proxy / traefik ] ← HTTPS terminates here + │ (external "proxy" network) + ┌────▼────┐ internal network ┌──────────┐ ┌────────────┐ + browser ───────────────────────│ nginx │ ───── /api/ ───────> │ api │ → │ postgres │ + │ (html/) │ │ FastAPI │ │ (db) │ + └─────────┘ └──────────┘ └────────────┘ ``` Everything runs inside your firewall; the app makes **no outbound internet -calls** (the logo and scripts are local and the old Google-Fonts dependency was -removed). +calls** (logo and scripts are local). -## 1. Front end (NGINX) +> **Architecture note:** all static files live under **`html/`** and are *baked +> into the nginx image* at build time (not bind-mounted). So after any front-end +> change you rebuild the `webserver` image (see *Updating* below). The API image +> is built from the root `Dockerfile`. -Copy the project files to a web root and serve them over HTTPS. The provided -[`nginx-wp-suite.conf`](nginx-wp-suite.conf) serves the static files and proxies -`/api/` to the Python API. Set `server_name`, the `ssl_certificate` paths, and -`root`, then `sudo nginx -t && sudo systemctl reload nginx`. +--- -Serving over real HTTP(S) (not `file://`) also makes the embedded Work Package -Creator (`