Deployment

Docker Compose Deployment

Full edge stack with Postgres, Redis, gateway, and dashboard.

Docker Compose Deployment

Overview

Run the full AgentTrust stack locally or on a single node: PostgreSQL, Redis, FastAPI gateway, and React dashboard via docker compose up.

Why It Matters

Docker Compose is the recommended staging environment and the fastest path to the full governance engine suite.

Prerequisites

  • Docker and Docker Compose
  • agentrust-edge/ directory

Step-by-Step Guide

1. Navigate and configure

cd agentrust-edge/
cp .env.example .env  # if exists, or set vars below

Required environment variables:

POSTGRES_PASSWORD=your_secure_password
REDIS_PASSWORD=your_redis_password
AGENTRUST_JWT_SECRET=your_jwt_secret_min_32_chars

Optional:

AGENTRUST_API_KEYS=at_team_key1,at_team_key2

2. Start stack

docker compose up -d

3. Verify services

4. Point SDK at gateway

export AGENTRUST_GATEWAY_URL=http://localhost:8000
export AGENTRUST_KEY=at_team_your_key

5. Stop

docker compose down

Examples

Smoke test:

curl http://localhost:8000/health

Best Practices

  • Never use default passwords in production
  • Mount policy packs as read-only volumes
  • Set AUTH_ENABLED=true (default in production compose)
  • Back up PostgreSQL volume regularly
  • Set VITE_API_URL for dashboard to gateway URL

Common Mistakes

  • Forgetting AGENTRUST_JWT_SECRET (auth fails)
  • Exposing port 5432 publicly
  • Running without Redis (judge queue and rate limiting break)

Troubleshooting

IssueFix
Gateway won't startCheck docker compose logs gateway
Dashboard blankVerify VITE_API_URL points to gateway
DB migration errorsSet AGENTRUST_AUTO_MIGRATE=true for dev