version: '3.8'
services:
# PostgreSQL with pgvector for production deployment
postgres:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: mcp_pa
POSTGRES_USER: mcp_user
POSTGRES_PASSWORD: mcp_password
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mcp_user -d mcp_pa"]
interval: 10s
timeout: 5s
retries: 5
# Redis for caching and session management
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
# MCP Personal Assistant HTTP Server
mcp-server:
build:
context: .
dockerfile: Dockerfile
environment:
- ENVIRONMENT=production
- DATABASE_URL=postgresql://mcp_user:mcp_password@postgres:5432/mcp_pa
- REDIS_URL=redis://redis:6379
- VECTOR_SEARCH_ENABLED=true
- EMBEDDING_PROVIDER=local
- AUTH_ENABLED=false # Set to true with proper OAuth config for production
- SERVER_HOST=0.0.0.0
- SERVER_PORT=8000
- LOG_LEVEL=INFO
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./data:/app/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
volumes:
postgres_data:
redis_data: