Deployment
Docker Deployment
Section titled “Docker Deployment”Production Configuration
Section titled “Production Configuration”Create a production compose file:
services: frontend: build: context: ./frontend target: production ports: - "80:80"
api: build: context: ./backend target: production environment: - ENV=production
timescaledb: volumes: - postgres_data:/var/lib/postgresql/dataDeploy
Section titled “Deploy”docker compose -f docker-compose.prod.yml up -dEnvironment Configuration
Section titled “Environment Configuration”Required Variables
Section titled “Required Variables”# Production .envDB_PASSWORD=strong_random_passwordJWT_SECRET=another_strong_random_secretPOLYGON_API_KEY=your_production_keySecurity Checklist
Section titled “Security Checklist”- Strong database password
- JWT secret rotated
- API keys secured
- HTTPS enabled
- Rate limiting configured
Cloudflare Pages
Section titled “Cloudflare Pages”For the marketing site and documentation:
- Connect your GitHub repository
- Configure build settings:
- Build command:
npm run build - Output directory:
dist
- Build command:
- Deploy
Environment Variables
Section titled “Environment Variables”Set in Cloudflare dashboard:
PUBLIC_API_URL- Your API endpoint
Database Backups
Section titled “Database Backups”Automated Backups
Section titled “Automated Backups”pg_dump -h localhost -U postgres quantum_trader > backup_$(date +%Y%m%d).sqlScheduled via cron
Section titled “Scheduled via cron”0 2 * * * /path/to/backup.shMonitoring
Section titled “Monitoring”Health Checks
Section titled “Health Checks”# API healthcurl http://localhost:8501/health
# Database healthdocker compose exec timescaledb pg_isready# All servicesdocker compose logs -f
# Specific servicedocker compose logs -f apiNext Steps
Section titled “Next Steps”- Architecture - System overview
- API Reference - Integration options