Docker Compose Quickstart
Docker Compose is the fastest way to run GOVERN. Use it for local development, proof-of-concept deployments, or small teams.
Prerequisites
- Docker 24+
- Docker Compose 2.20+
- 4 GB free RAM
- 20 GB free disk space
Quickstart
# Download docker-compose.ymlcurl -O https://releases.govern.archetypal.ai/latest/docker-compose.ymlcurl -O https://releases.govern.archetypal.ai/latest/.env.example
# Configure environmentcp .env.example .env# Edit .env with your settings
# Start GOVERNdocker compose up -d
# Check statusdocker compose ps
# View logsdocker compose logs -f govern-apiGOVERN is available at http://localhost:3000 within ~60 seconds.
docker-compose.yml
version: '3.9'
services: govern-api: image: archetypal/govern-api:latest restart: unless-stopped ports: - "3001:3001" env_file: .env environment: - DATABASE_URL=postgresql://govern:${POSTGRES_PASSWORD}@postgres:5432/govern - REDIS_URL=redis://redis:6379 depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: - govern-data:/data
govern-app: image: archetypal/govern-app:latest restart: unless-stopped ports: - "3000:80" environment: - API_URL=http://govern-api:3001
govern-probe: image: archetypal/govern-probe:latest restart: unless-stopped environment: - GOVERN_API_URL=http://govern-api:3001 - GOVERN_API_KEY=${GOVERN_API_KEY} network_mode: host # Required for transparent proxy
postgres: image: postgres:15-alpine restart: unless-stopped environment: - POSTGRES_DB=govern - POSTGRES_USER=govern - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} volumes: - postgres-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U govern"] interval: 10s timeout: 5s retries: 5
redis: image: redis:7-alpine restart: unless-stopped command: redis-server --requirepass ${REDIS_PASSWORD} volumes: - redis-data:/data healthcheck: test: ["CMD", "redis-cli", "--no-auth-warning", "-a", "${REDIS_PASSWORD}", "ping"] interval: 10s timeout: 5s retries: 5
volumes: govern-data: postgres-data: redis-data:Environment Variables (.env)
# GOVERNGOVERN_LICENSE_KEY=your-license-keyGOVERN_API_KEY=your-api-key # Set this to a secure random stringGOVERN_SECRET_KEY=your-secret-key # JWT signing key
# DatabasePOSTGRES_PASSWORD=change-me-in-production
# RedisREDIS_PASSWORD=change-me-in-production
# Auth (optional — remove for dev, required for production)AUTH_PROVIDER=local # local | saml | oidcSESSION_TIMEOUT=28800 # 8 hours in seconds
# Notifications (optional)SLACK_WEBHOOK_URL=PAGERDUTY_API_KEY=Common Operations
# Stop GOVERNdocker compose down
# Update to latest versiondocker compose pulldocker compose up -d
# Run migrations manuallydocker compose exec govern-api npx govern-migrate up
# Reset all data (destructive)docker compose down -vdocker compose up -d
# View resource usagedocker stats govern-api govern-app postgres redisEnabling TLS
For production Docker Compose deployments, add an Nginx TLS terminator:
nginx: image: nginx:alpine restart: unless-stopped ports: - "80:80" - "443:443" volumes: - ./nginx.conf:/etc/nginx/nginx.conf - /etc/letsencrypt:/etc/letsencrypt:ro