Skip to main content
The local BYOC stack in deploy/docker-compose.yml runs two containers inside your own host or VM:
  1. postgres (postgres:16-alpine): Automatically applies db/migrations/001_audit_ledger.sql via /docker-entrypoint-initdb.d/ to initialize audit_ledger (trg_audit_ledger_immutable) and approval_requests.
  2. portkey-gateway (portkeyai/gateway:latest): Routes zero-retention model requests using deploy/portkey/config.json with fallback and x-truly-agentic-retention: zero-training headers.
All ports bind strictly to 127.0.0.1 (5432 and 8787). Never expose docker-compose.yml ports to 0.0.0.0 on public cloud hosts; expose services only inside a private VPC subnet or encrypted Tailscale/WireGuard tunnel.

Start the Stack

1

Copy the example environment file

2

Populate local secrets in deploy/.env

3

Start PostgreSQL 16 and Portkey Gateway

4

Verify health and loopback bindings

Confirm postgres reports healthy (pg_isready -U ta_ledger -d governance_ledger) and ports bind only to 127.0.0.1.

Routing Strategy (deploy/portkey/config.json)

The reference gateway config enables retries on HTTP 429, 500, 502, 503, and 504 across routine-extraction (claude-haiku-4-5) and reasoning-fallback (gpt-4.1-mini with "store": false) while injecting x-truly-agentic-retention: zero-training. For strict VPC-isolated inference in production, point targets at your private AWS Bedrock, GCP Vertex AI, or Azure OpenAI endpoint.