Docker Deployment
Docker Compose is the recommended way to run RedCloud on a single host.
What Compose runs
Section titled “What Compose runs”The root docker-compose.yml defines four services:
| Service | Image / build | Published port |
|---|---|---|
postgres | postgres:16-alpine | ${DB_PORT:-5432} |
redcloud | builds Dockerfile (backend + frontend) | ${PORT:-9900} |
license-server | builds Dockerfile.license | ${LICENSE_PORT:-7700} |
scheduler | builds scheduler/Dockerfile | none |
Each service has a health check (pg_isready, curl /health, curl /, and a process check for the scheduler). Persistent data uses a named pgdata volume, scan output is mounted from ./out, and cloud credentials are mounted read-only from ./credentials.
Deploy
Section titled “Deploy”# 1. Configure environmentcp .env.example .env# edit .env — set HMAC_KEY, API_KEY, ENCRYPTION_KEY, DB_PASSWORD, license, etc.
# 2. Provide cloud credentialsmkdir -p credentials# place your GCP service-account key at credentials/sa-key.json
# 3. Startdocker compose up -ddocker compose logs -f
# Stop (keep data):docker compose down# Stop and delete the database volume:docker compose down -vOpen http://<host>:9900 once the redcloud health check is passing.
Images
Section titled “Images”Dockerfile— multi-stage: anode:20-alpinestage builds the frontend, apython:3.12-slimstage installs the gcloud CLI and Python dependencies, copies the built frontend into the backend’s static directory, runs as a non-rootredclouduser, exposes9900, and startsuvicorn api.app:appwith two workers. The start command honors a dynamic$PORT(so it runs on Cloud Run unchanged).Dockerfile.production— a hardened variant that compiles the Python to bytecode and ships.pyconly (no source). Runtime behavior is identical.Dockerfile.license— the standalone license server on7700.
Health, metrics, and operations
Section titled “Health, metrics, and operations”| Endpoint | Purpose |
|---|---|
GET /health | Liveness (used by the container health check) |
GET /health?deep=true | Database, disk, gcloud, and security-posture diagnostics |
GET /metrics | Prometheus metrics |
GET /api/versions | API version info |
Back up PostgreSQL on a schedule (the deployment runbook suggests a nightly backup.sh cron) and restore with the provided restore script.