Stack
docker-compose.yml defines:
| Service | Role | Port |
|---|---|---|
redis | quote cache + pubsub + sponsor caps | 6379 |
postgres | indexer destination | 5432 (compose internal) / 5433 (host) |
migrate | one-shot Drizzle migration | n/a |
api | Fastify REST + WS | 8081 |
indexer | Sui event poller | n/a |
quote-worker | hot-strike quote poller | n/a |
resolver | OO settlement + auto-settle keeper | 8082 |
agent | (opt-in) agent runtime | 8083 |
@darkpool/* services run off the same image. One node:22-slim + corepack pnpm + tsx Dockerfile, no build step, identical runtime to local dev. Compose picks the process via command:.
Bring it up
migrate service gates the db consumers via service_completed_successfully so api/indexer never start against an unmigrated db.
Verify:
Agent profile
After editing backend code
Stop everything
Reset the database
Networking
- Same repo-root
.envviaenv_file:. - Only
REDIS_URL(redis://redis:6379),DATABASE_URL(postgres://…:5432/darkpool), and the agent’sSERVER_HTTP_URL=http://api:8081are overridden per-service for in-network DNS. .binary-markets/is mounted read-only into api + indexer so registry lookups resolve.packageManager: pnpm@8.13.1is pinned (9.0.0 made corepack pick a pnpm that can’t frozen-install the repo’s v6 lockfile).
Healthchecks
apihealthcheck =node -e fetch(...)(slim has no curl). Gates the agent viaservice_healthy.- Agent waits for
${SERVER_URL}/health(60s deadline) before its first tick, which covers host-mode boots too.
Dockerfile
pnpm build step. Every service runs via tsx directly off source. Identical to local dev, which means one less thing to break.