This is a major refactoring of the MCP Server to support multiple providers through a YAML-based configuration system with factory pattern implementation. ## Key Changes ### Architecture Improvements - Modular configuration system with YAML-based settings - Factory pattern for LLM, Embedder, and Database providers - Support for multiple database backends (Neo4j, FalkorDB, KuzuDB) - Clean separation of concerns with dedicated service modules ### Provider Support - **LLM**: OpenAI, Anthropic, Gemini, Groq - **Embedders**: OpenAI, Voyage, Gemini, Anthropic, Sentence Transformers - **Databases**: Neo4j, FalkorDB, KuzuDB (new default) - Azure OpenAI support with AD authentication ### Configuration - YAML configuration with environment variable expansion - CLI argument overrides for runtime configuration - Multiple pre-configured Docker Compose setups - Proper boolean handling in environment variables ### Testing & CI - Comprehensive test suite with unit and integration tests - GitHub Actions workflows for linting and testing - Multi-database testing support ### Docker Support - Updated Docker images with multi-stage builds - Database-specific docker-compose configurations - Persistent volume support for all databases ### Bug Fixes - Fixed KuzuDB connectivity checks - Corrected Docker command paths - Improved error handling and logging - Fixed boolean environment variable expansion Co-authored-by: Claude <noreply@anthropic.com>
51 lines
1.2 KiB
Docker
51 lines
1.2 KiB
Docker
# syntax=docker/dockerfile:1.9
|
|
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install uv using the installer script
|
|
ADD https://astral.sh/uv/install.sh /uv-installer.sh
|
|
RUN sh /uv-installer.sh && rm /uv-installer.sh
|
|
|
|
# Add uv to PATH
|
|
ENV PATH="/root/.local/bin:${PATH}"
|
|
|
|
# Configure uv for optimal Docker usage
|
|
ENV UV_COMPILE_BYTECODE=1 \
|
|
UV_LINK_MODE=copy \
|
|
UV_PYTHON_DOWNLOADS=never \
|
|
MCP_SERVER_HOST="0.0.0.0" \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
# Create non-root user
|
|
RUN groupadd -r app && useradd -r -d /app -g app app
|
|
|
|
# Copy project files for dependency installation (better caching)
|
|
COPY pyproject.toml uv.lock ./
|
|
|
|
# Install dependencies first (better layer caching)
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv sync --frozen --no-dev
|
|
|
|
# Copy application code and configuration
|
|
COPY main.py ./
|
|
COPY src/ ./src/
|
|
COPY config/ ./config/
|
|
|
|
# Change ownership to app user
|
|
RUN chown -Rv app:app /app
|
|
|
|
# Switch to non-root user
|
|
USER app
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Command to run the application
|
|
CMD ["uv", "run", "main.py"]
|