Deploying AccelerUp
Docker Swarm, rolling updates, zero downtime, and the migration lock.
Local development
make up # docker-compose up --build -d
make logs
make seed # sample data
make downBackend only, against a local Postgres:
make dev-backend # go run ./cmd/serverFrontend:
cd frontend && npm run devProduction: Docker Swarm
Production runs on Docker Swarm with rolling updates. The earlier deployment
did docker-compose down first, which is a full outage on every release.
./scripts/deploy-swarm.shThe stack starts the new task before stopping the old one, so there is a period where both versions are serving. Two things follow from that:
- Migrations must be backwards-compatible for one release. The old code must keep working against the new schema for the length of the rollout.
- Migrations take an advisory lock, so two replicas starting together do not run them concurrently.
See Database migrations.
The nginx seam
nginx sits in front and routes by host:
| Host | Serves |
|---|---|
monitoring.qrdev.org | The application |
docs.monitoring.qrdev.org | This documentation (static) |
The documentation is a static export — plain HTML files with no Node process behind them. That is deliberate: the site somebody opens because something has fallen over should not depend on a runtime that can fall over.
Health endpoints
| Endpoint | Purpose |
|---|---|
/health | Liveness — the process is up |
/ready | Readiness — the database is reachable and migrations have run |
The load balancer should use /ready. A replica that is up but has not
finished migrating is not ready to serve.
Rollout order
- Migrations run on the first replica to acquire the lock.
- New replicas start, pass
/ready, and enter rotation. - Old replicas drain and stop.
- Workers move to whichever replica wins the leader election.
A worker moving replicas mid-rollout is normal and safe: work is claimed from the database, not held in memory.
Configuration
Environment only. See Environment variables.
Secrets come from Infisical in this deployment; see the platform notes in the repository. Nothing reads a config file.
Rolling back
Deploy the previous image tag. Because migrations are additive and backwards-compatible for a release, the previous code runs against the current schema.
Rolling back across a destructive migration is not safe. Migrations that drop or rename are written as two releases — add, migrate, then remove in the next release — precisely so a rollback within one release is always possible.
Deploying the documentation
cd docs-site
npm run build # generates the API reference, the search index, then exportsThe output is docs-site/out/ — static files. Serve that directory with nginx
at docs.monitoring.qrdev.org.
Where this behaviour lives: scripts/deploy-swarm.sh, deploy/swarm/, docker-compose.yml. If the code and this page disagree, the code is right — please fix the page.
Part of Running AccelerUp — Operating the platform itself: architecture, deploys, backups.