BizOSaaS Platform Deployment Runbook
Overview
This document provides instructions for deploying and managing the BizOSaaS platform components, including the Brain Gateway, frontend portals, and integrated services (Wagtail, WordPress, etc.).
1. Staging Deployment (GitHub Actions)
Prerequisites
- GitHub secrets configured:
DOKPLOY_API_KEY: API key for the Dokploy instance.DOKPLOY_BRAIN_GATEWAY_WEBHOOK: Webhook URL for the Brain Gateway service in Dokploy.GITHUB_TOKEN: (Automatic) Used to push containers to GHCR.
Procedure
- Trigger via Push: Push changes to the
stagingormainbranch. - Manual Trigger:
- Go to GitHub Actions > "Deploy to Staging".
- Click "Run workflow".
- Verify: Check the Dokploy console for deployment status.
2. Manual Deployment Scripts
Scripts Overview
scripts/deploy-staging-to-dokploy.sh: Full platform staging deployment.scripts/verify-cicd-setup.sh: Verify local environment before deployment.scripts/generate_api_docs.py: Update API reference documentation.
Example: Running a local verification
bash scripts/verify-cicd-setup.sh
3. Hybrid Local Bridge (Temporal & n8n)
To optimize VPS resources, Temporal and n8n can be hosted on a local laptop and bridged to the VPS via Cloudflare Tunnels.
Prerequisites
- Docker & Docker Compose installed on laptop.
- Cloudflare account with a Tunnel created.
CLOUDFLARE_TUNNEL_TOKENavailable.
Procedure
- Network Setup:
docker network create temporal-network - Start Services:
docker compose -f infrastructure/compose/temporal-local.yml up -d
docker compose -f infrastructure/compose/n8n-local.yml up -d
docker compose -f infrastructure/compose/cloudflared.yml up -d - Configure VPS Gateway:
- Update
.env.productionon the VPS to pointTEMPORAL_ADDRESStotemporal-bridge.bizoholic.com:7233.
- Update
4. High Availability & Resource Optimization
The platform uses KAG (Knowledge Augmented Generation) and per-tenant rate limiting. Ensure the following:
- KVM2 instance has at least 8GB RAM.
- Dokploy resource limits are configured for each container.
5. Rollback Plan
- In the GitHub Action, re-run a previous successful job.
- In Dokploy, use the "Rollback" feature to switch back to the previous image tag (
stagingor specific SHA).