-
Notifications
You must be signed in to change notification settings - Fork 4
Deployment CICD
This page describes the current deployment path without storing secrets. Keep real keys in GitHub Secrets or the Durham server .env only.
- Source of truth: GitHub repository
lobx-platform/lobx. - CI/CD entrypoint:
.github/workflows/docker-build-push.yml. - Backend runtime: Docker container on the Durham server, managed by
docker-compose.server.yml. - Public backend URL: ngrok reserved domain, default
https://dthinkr.ngrok.app. - Frontend runtime: Firebase Hosting, currently
https://london-trader.web.app. - Participant path: browser loads Firebase frontend, then calls the backend through the ngrok HTTPS/WSS endpoint.
- A push to
mainor manualworkflow_dispatchstarts the workflow. -
build-backendbuildsdocker.io/venvoo/trading_platform:backfrom./backand pushes both the mutablebacktag and a SHA tag. -
deploy-backendSSHes into the Durham server using GitHub Secrets and runs/root/trading_platform/deploy.sh. -
deploy-frontendbuilds the Vue frontend with the public backend URLs and deploys to Firebase Hosting.
GitHub Secrets used by the current workflow:
DOCKERHUB_USERNAMEDOCKERHUB_TOKENSERVER_HOSTSERVER_USERSERVER_SSH_KEYSERVER_SSH_PASSPHRASEFIREBASE_SERVICE_ACCOUNTADMIN_PASSWORDTURNSTILE_SECRET_KEY-
NGROK_AUTHTOKENpreferred for new deployments -
NGROK_YMLlegacy fallback while migrating existing deployments
The server repo should live at /root/trading_platform unless APP_DIR is set differently.
Required local files on the server:
.envback/config/auth/firebase-service-account.jsondocker-compose.server.ymldeploy.sh
Use .env.example as the non-secret template for expected environment variables.
Expected .env entries on the server:
ADMIN_PASSWORDFIREBASE_API_KEYFIREBASE_AUTH_DOMAINFIREBASE_PROJECT_IDFIREBASE_STORAGE_BUCKETFIREBASE_MESSAGING_SENDER_IDFIREBASE_APP_IDFIREBASE_MEASUREMENT_IDOPENROUTER_API_KEYTURNSTILE_SECRET_KEYNGROK_AUTHTOKEN-
NGROK_DOMAINoptional, defaults todthinkr.ngrok.app
deploy.sh fails early if ADMIN_PASSWORD or NGROK_AUTHTOKEN is missing. docker-compose.server.yml also passes ADMIN_PASSWORD into the backend container because the backend reads the admin password from the process environment.
cd /root/trading_platform
chmod +x deploy.sh
./deploy.shOptional overrides:
DEPLOY_BRANCH=main COMPOSE_FILE=docker-compose.server.yml ./deploy.shIf Durham introduces VPN-only administrator access, the experiment can keep working as long as these paths remain available:
- The Durham server can make outbound connections to Docker Hub to pull backend images.
- The Durham server can make outbound connections to GitHub to pull repository changes.
- The Durham server can make outbound connections to ngrok so the public backend URL remains reachable.
- GitHub Actions can SSH to the Durham server, or Durham provides an alternative such as a self-hosted runner, bastion, or approved allowlist path.
The backend container should be bound to 127.0.0.1:8000 in the server compose file. Public participant traffic should go through ngrok, not directly to port 8000.
If Durham blocks GitHub-hosted runner SSH access, the likely fixes are:
- Use a self-hosted GitHub Actions runner inside Durham's network.
- Keep a manually triggered server deploy after VPN login.
- Ask Durham to allow GitHub Actions SSH traffic to the deployment host.
- Confirm who owns the GitHub repo and Docker Hub namespace.
- Confirm at least two maintainers have access to GitHub Secrets.
- Rotate any token that has ever appeared in committed files or meeting notes.
- Confirm
/root/trading_platform/deploy.shis the repo version and executable. - Confirm server
.envhasADMIN_PASSWORDandNGROK_AUTHTOKEN, and no real secrets are committed. - Confirm Firebase service account JSON exists only on the server and in GitHub Secrets.
- Run a manual
workflow_dispatchdeploy before the next live lab session. - Verify
https://dthinkr.ngrok.apphealth from outside Durham. - Verify Firebase frontend can connect to both HTTPS and WSS backend endpoints.
- Document Durham's final VPN/firewall policy once they confirm it.