mcp-client / Projects /LeaseGuard /docker-compose.prod.yml
Raj718's picture
feat: Complete Task 9 - Security Hardening & Production Deployment with 67 tests passing
16cf46c
version: '3.8'
services:
# Redis for production
redis:
image: redis:7-alpine
container_name: leaseguard-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
networks:
- leaseguard-network
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 30s
timeout: 10s
retries: 3
# LeaseGuard application
app:
build:
context: .
dockerfile: Dockerfile
container_name: leaseguard-app
restart: unless-stopped
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- REDIS_URL=redis://:${REDIS_PASSWORD}@redis:6379
- GEMINI_API_KEY=${GEMINI_API_KEY}
- SUPABASE_URL=${SUPABASE_URL}
- SUPABASE_ANON_KEY=${SUPABASE_ANON_KEY}
- SESSION_SECRET=${SESSION_SECRET}
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS}
depends_on:
redis:
condition: service_healthy
networks:
- leaseguard-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Nginx reverse proxy for SSL termination
nginx:
image: nginx:alpine
container_name: leaseguard-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- app
networks:
- leaseguard-network
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 30s
timeout: 10s
retries: 3
volumes:
redis_data:
driver: local
networks:
leaseguard-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16