version: '3.8' services: discord-rag: build: . container_name: discord-guild-rag restart: unless-stopped # Environment file env_file: - config/.env # Mount data directory for persistence volumes: - ./data:/app/data - ./config/.env:/app/config/.env:ro # For MCP server (if needed to expose) # ports: # - "8000:8000" # Resource limits deploy: resources: limits: memory: 2G cpus: '1.0' reservations: memory: 512M cpus: '0.5' # Health check healthcheck: test: ["CMD", "python", "-c", "import sys; sys.path.append('src'); from database import DiscordRAGDatabase; print('healthy')"] interval: 30s timeout: 10s retries: 3 start_period: 30s # Optional: Discord bot service for real-time collection discord-bot: build: . container_name: discord-guild-rag-bot restart: unless-stopped env_file: - config/.env volumes: - ./data:/app/data - ./config/.env:/app/config/.env:ro command: ["python", "-m", "src.main", "bot"] depends_on: - discord-rag deploy: resources: limits: memory: 1G cpus: '0.5'