Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM python:3.11-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy source code and project files
COPY src/ src/
COPY pyproject.toml .
COPY README.md .

# Install the package
RUN pip install -e .

# Create non-root user
RUN useradd -r -u 1001 appuser && \
chown -R appuser:appuser /app
USER appuser

# Expose default port for SSE mode
EXPOSE 8000

# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import pymilvus; print('OK')" || exit 1

# Default command
CMD ["mcp-server-milvus", "--sse", "--port", "8000"]
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.8'

services:
mcp-server-milvus:
build: .
container_name: mcp-server-milvus
ports:
- "${MCP_PORT:-8000}:8000"
environment:
- MILVUS_HOST=milvus-standalone
- MILVUS_PORT=19530
- MILVUS_USER=${MILVUS_USER}
- MILVUS_PASSWORD=${MILVUS_PASSWORD}
- MILVUS_DB_NAME=${MILVUS_DB_NAME:-default}
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fastmcp>=2.6.1
pymilvus>=2.5.1
click>=8.0.0
ruff>=0.11.0
python-dotenv>=1.0.0