Complete production-ready deployment package enabling implementers to deploy Tractatus with all 5 governance services in 30 minutes using Docker Compose. **Package Contents (15KB):** 1. docker-compose.yml - MongoDB 7.0 with authentication - Tractatus Node.js application - Health checks and volume management - Network configuration 2. Dockerfile - Multi-stage build (builder + production) - Security-hardened (non-root user, minimal image) - Health checks integrated - Production-optimized 3. .env.example - Complete configuration template - All 5 governance service toggles - Required secrets (MongoDB, JWT, Admin) - Feature flags and optional services - Rate limiting, CORS, CSP configuration 4. sample-governance-rules.json - 10 production-ready governance rules - STR-001: BoundaryEnforcer (human approval for values) - STR-002: CrossReferenceValidator (port specifications) - OPS-001: ContextPressureMonitor (pressure monitoring) - OPS-002: InstructionPersistenceClassifier (classification) - TAC-001: MetacognitiveVerifier (complex verification) - SYS-001/002: Database and project isolation - SEC-001: CSP enforcement - VAL-001: Te Tiriti commitment - QUAL-001: World-class quality 5. verify-deployment.sh - Automated verification (40+ checks) - 7 test categories: env, Docker, network, DB, services, security, files - Color-coded output (pass/fail/warn) - CI/CD integration ready 6. TROUBLESHOOTING.md - Comprehensive troubleshooting guide - 6 major sections covering common deployment issues - Docker, database, application, services, performance, security - Quick reference commands 7. README.md - "Deploy in 30 minutes" guide - 6-step quickstart (2+5+10+3+5+5 minutes) - Configuration guide (basic + production) - Testing procedures and monitoring - Architecture diagram - Backup/restore procedures 8. scripts/load-governance-rules.js - Loads sample rules into MongoDB - JSON validation and error handling - Creates indexes (rule_id, quadrant, enforced_by) - Summary statistics by quadrant and service **Implementer Page Updates:** - Added prominent "Deployment Quickstart Kit" section after hero - Green gradient background with "NEW" badge - Two-column layout: description + download / file list - Download button: /downloads/tractatus-quickstart.tar.gz (15KB) - Professional design matching site aesthetic **Deliverables:** ✅ Production-ready Docker Compose configuration ✅ Complete environment configuration template ✅ 10 sample governance rules (all 5 services) ✅ Automated deployment verification (40+ tests) ✅ Comprehensive troubleshooting guide ✅ Step-by-step deployment guide (30 minutes) ✅ Database initialization scripts ✅ Package deployed to production **Testing:** - Package structure validated - File permissions correct (644/755) - Deployed to https://agenticgovernance.digital/downloads/ - Implementer page updated with download section **Roadmap Progress:** Phase 1, Week 2, Task 6: Deployment Quickstart Kit - COMPLETED Priority: High | Effort: 3-4 days | Status: ✅ Done Next: Task 8 - Technical Architecture Diagram (Week 3) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
107 lines
3.1 KiB
YAML
107 lines
3.1 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# MongoDB Database
|
|
mongodb:
|
|
image: mongo:7.0
|
|
container_name: tractatus-mongodb
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${MONGODB_PORT:-27017}:27017"
|
|
environment:
|
|
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USERNAME:-tractatus}
|
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD:-changeme}
|
|
MONGO_INITDB_DATABASE: ${MONGODB_DATABASE:-tractatus_prod}
|
|
volumes:
|
|
- mongodb_data:/data/db
|
|
- mongodb_config:/data/configdb
|
|
networks:
|
|
- tractatus-network
|
|
healthcheck:
|
|
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Tractatus Application
|
|
tractatus-app:
|
|
build:
|
|
context: ..
|
|
dockerfile: deployment-quickstart/Dockerfile
|
|
container_name: tractatus-app
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${APP_PORT:-9000}:9000"
|
|
environment:
|
|
NODE_ENV: ${NODE_ENV:-production}
|
|
PORT: 9000
|
|
MONGODB_URI: mongodb://${MONGODB_USERNAME:-tractatus}:${MONGODB_PASSWORD:-changeme}@mongodb:27017/${MONGODB_DATABASE:-tractatus_prod}?authSource=admin
|
|
JWT_SECRET: ${JWT_SECRET}
|
|
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
|
|
ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@tractatus.local}
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
|
|
SESSION_SECRET: ${SESSION_SECRET}
|
|
BASE_URL: ${BASE_URL:-http://localhost:9000}
|
|
|
|
# Governance Service Configuration
|
|
BOUNDARY_ENFORCER_ENABLED: ${BOUNDARY_ENFORCER_ENABLED:-true}
|
|
CONTEXT_PRESSURE_ENABLED: ${CONTEXT_PRESSURE_ENABLED:-true}
|
|
CROSS_REF_VALIDATOR_ENABLED: ${CROSS_REF_VALIDATOR_ENABLED:-true}
|
|
PERSISTENCE_CLASSIFIER_ENABLED: ${PERSISTENCE_CLASSIFIER_ENABLED:-true}
|
|
METACOGNITIVE_VERIFIER_ENABLED: ${METACOGNITIVE_VERIFIER_ENABLED:-true}
|
|
|
|
# Performance & Limits
|
|
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-900000}
|
|
RATE_LIMIT_MAX_REQUESTS: ${RATE_LIMIT_MAX_REQUESTS:-100}
|
|
MAX_FILE_SIZE: ${MAX_FILE_SIZE:-10485760}
|
|
|
|
# Feature Flags
|
|
BLOG_ENABLED: ${BLOG_ENABLED:-true}
|
|
KOHA_ENABLED: ${KOHA_ENABLED:-true}
|
|
DEMOS_ENABLED: ${DEMOS_ENABLED:-true}
|
|
ANALYTICS_ENABLED: ${ANALYTICS_ENABLED:-false}
|
|
|
|
volumes:
|
|
- app_logs:/app/logs
|
|
- app_uploads:/app/uploads
|
|
depends_on:
|
|
mongodb:
|
|
condition: service_healthy
|
|
networks:
|
|
- tractatus-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:9000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
volumes:
|
|
mongodb_data:
|
|
driver: local
|
|
mongodb_config:
|
|
driver: local
|
|
app_logs:
|
|
driver: local
|
|
app_uploads:
|
|
driver: local
|
|
|
|
networks:
|
|
tractatus-network:
|
|
driver: bridge
|
|
|
|
# Optional: Nginx reverse proxy (uncomment if needed)
|
|
# nginx:
|
|
# image: nginx:alpine
|
|
# container_name: tractatus-nginx
|
|
# restart: unless-stopped
|
|
# ports:
|
|
# - "80:80"
|
|
# - "443:443"
|
|
# volumes:
|
|
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
# - ./ssl:/etc/nginx/ssl:ro
|
|
# depends_on:
|
|
# - tractatus-app
|
|
# networks:
|
|
# - tractatus-network
|