# Context7-style MCP System - Docker Compose (Production/Home Server Hardened) services: # Qdrant Vector Database Service qdrant: image: qdrant/qdrant:latest container_name: qdrant ports: - "${QDRANT_PORT:-6333}:6333" volumes: - ./data/qdrant:/qdrant/storage environment: - QDRANT__MEMORY_MAPPED_INDEXES=1 restart: unless-stopped logging: driver: json-file options: max-size: "10m" max-file: "3" networks: - context7-network # Docs API Backend Service (FastAPI) docs-api: build: context: ./backend dockerfile: Dockerfile container_name: docs-api ports: - "${HOST_PORT:-8787}:8787" environment: - VECTOR_STORE_HOST=qdrant - VECTOR_STORE_PORT=6333 - DOCS_PATH=/docs - DB_PATH=/data/db.sqlite - LOG_LEVEL=INFO - API_KEY_DOCS_API=${DOCS_API_KEY:-} volumes: - ./docs:/docs - ./data:/data - ./docs_sources.yaml:/app/docs_sources.yaml depends_on: - qdrant networks: - context7-network healthcheck: test: ["CMD", "curl", "-f", "http://localhost:${HOST_PORT:-8787}/health"] interval: 30s timeout: 10s retries: 3 start_period: 15s # MCP Server Service (FastMCP via streamable HTTP) docs-mcp: build: context: ./mcp-server dockerfile: Dockerfile container_name: docs-mcp ports: - "${MCP_HOST_PORT:-8788}:8788" environment: - DOCS_API_URL=http://docs-api:8787 - MCP_API_KEY=${MCP_API_KEY:-} volumes: - ./docs:/docs:ro - ./data:/data restart: unless-stopped logging: driver: json-file options: max-size: "10m" max-file: "3" depends_on: docs-api: condition: service_healthy networks: - context7-network # WebUI Service (HTML interface) webui: build: context: ./webui dockerfile: Dockerfile container_name: webui ports: - "${WEBUI_PORT:-8790}:8790" environment: - DOCS_API_URL=http://docs-api:8787 - WEBUI_API_KEY=${DOCS_WEBUI_API_KEY:-} volumes: - ./docs:/docs - ./data:/data depends_on: docs-api: condition: service_healthy networks: - context7-network networks: context7-network: driver: bridge