Add production deployment configurations and guides

Deployment options:
- Railway cloud deployment (recommended, 5-min setup)
- Render alternative deployment
- Docker Compose for VPS deployment
- Comprehensive environment variable documentation

Includes:
- Production-grade Dockerfile with multi-stage builds
- Docker Compose configuration for production
- Detailed deployment guide with troubleshooting
- Backup and recovery procedures
- Monitoring and scaling recommendations

Deployment paths ready:
 Railway (railway.app)
 Render (render.com)
 Self-hosted VPS (DigitalOcean, Linode, etc.)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
drjones
2026-07-07 05:17:03 +00:00
parent 989c00e5fb
commit 9841ff99bb
4 changed files with 350 additions and 9 deletions

56
docker-compose.prod.yml Normal file
View File

@@ -0,0 +1,56 @@
version: '3.9'
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: trustos
POSTGRES_USER: trustos
POSTGRES_PASSWORD: ${DB_PASSWORD:?Database password required}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U trustos"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: .
dockerfile: Dockerfile.prod
target: backend
environment:
DATABASE_URL: postgresql+asyncpg://trustos:${DB_PASSWORD}@postgres:5432/trustos
SYNC_DATABASE_URL: postgresql://trustos:${DB_PASSWORD}@postgres:5432/trustos
SECRET_KEY: ${SECRET_KEY:?Secret key required}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
AI_PROVIDER: ${AI_PROVIDER:-openai}
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/docs"]
interval: 30s
timeout: 10s
retries: 3
frontend:
build:
context: .
dockerfile: Dockerfile.prod
target: frontend
environment:
NEXT_PUBLIC_API_URL: ${API_URL:?API URL required}
ports:
- "3000:3000"
depends_on:
- backend
volumes:
postgres_data: