AccelerUpDocs
Running AccelerUp/Operations/Deploying

Deploying AccelerUp

Docker Swarm, rolling updates, zero downtime, and the migration lock.

Local development

bash
make up        # docker-compose up --build -d
make logs
make seed      # sample data
make down

Backend only, against a local Postgres:

bash
make dev-backend      # go run ./cmd/server

Frontend:

bash
cd frontend && npm run dev

Production: 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.

bash
./scripts/deploy-swarm.sh

The 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:

  1. Migrations must be backwards-compatible for one release. The old code must keep working against the new schema for the length of the rollout.
  2. 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:

HostServes
monitoring.qrdev.orgThe application
docs.monitoring.qrdev.orgThis 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

EndpointPurpose
/healthLiveness — the process is up
/readyReadiness — 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

  1. Migrations run on the first replica to acquire the lock.
  2. New replicas start, pass /ready, and enter rotation.
  3. Old replicas drain and stop.
  4. 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.

Warning

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

bash
cd docs-site
npm run build      # generates the API reference, the search index, then exports

The output is docs-site/out/ — static files. Serve that directory with nginx at docs.monitoring.qrdev.org.

See Contributing to these docs.

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 AccelerUpOperating the platform itself: architecture, deploys, backups.