What the stack contains

The repository Docker Compose stack includes an Nginx edge, one OpenTokenRouter master, one worker, PostgreSQL, and Redis. The master owns master-only jobs, while workers provide stateless routing capacity; both share the database and cache.

Start locally

cp .env.example .env
docker compose up -d --build

Open http://localhost:3000 after startup. The edge waits for both application services to become healthy. Replace the default database, Redis, and session secrets in production, and terminate HTTPS at the reverse proxy.

Scale workers

docker compose up -d --scale opentokenrouter-worker=3

Workers share PostgreSQL and Redis, so do not place article media, secret files, or persistent state in only one container filesystem. Store media in object storage and maintain tested database backups.

Pre-production checks

  • Use independent strong credentials for the database, Redis, and sessions.
  • Configure trusted proxies and the public ServerAddress so callbacks and SEO canonicals agree.
  • Test health checks, logs, backups, node removal, and failover.
  • Load-test real model requests before choosing the worker count.