version: '3.8' services: # Main KGraph-MCP Application kgraph-mcp: build: context: . dockerfile: Dockerfile ports: - "${PORT:-7860}:7860" environment: - ENVIRONMENT=${ENVIRONMENT:-production} - REDIS_URL=redis://redis:6379 - POSTGRES_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/kgraph_mcp - VECTOR_DB_URL=http://weaviate:8080 depends_on: - redis - postgres - weaviate volumes: - ./data:/app/data - ./logs:/app/logs restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:7860/health"] interval: 30s timeout: 10s retries: 3 # Redis for caching and session management redis: image: redis:7-alpine ports: - "6379:6379" volumes: - redis_data:/data restart: unless-stopped # PostgreSQL for persistent data postgres: image: postgres:15-alpine environment: - POSTGRES_DB=kgraph_mcp - POSTGRES_USER=postgres - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} volumes: - postgres_data:/var/lib/postgresql/data - ./deployment/init.sql:/docker-entrypoint-initdb.d/init.sql ports: - "5432:5432" restart: unless-stopped # Weaviate for vector embeddings and knowledge graph weaviate: image: semitechnologies/weaviate:1.23.1 ports: - "8080:8080" environment: - QUERY_DEFAULTS_LIMIT=25 - AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true - PERSISTENCE_DATA_PATH=/var/lib/weaviate volumes: - weaviate_data:/var/lib/weaviate restart: unless-stopped # Nginx reverse proxy nginx: image: nginx:alpine ports: - "80:80" - "443:443" volumes: - ./deployment/nginx.conf:/etc/nginx/nginx.conf - ./deployment/ssl:/etc/nginx/ssl depends_on: - kgraph-mcp restart: unless-stopped # Monitoring with Prometheus prometheus: image: prom/prometheus:latest ports: - "9090:9090" volumes: - ./deployment/prometheus.yml:/etc/prometheus/prometheus.yml - prometheus_data:/prometheus restart: unless-stopped # Log aggregation loki: image: grafana/loki:latest ports: - "3100:3100" volumes: - loki_data:/loki restart: unless-stopped volumes: redis_data: postgres_data: weaviate_data: prometheus_data: loki_data: