Initial commit: Monarch MCP Custom SSE server
This commit is contained in:
41
Dockerfile
Normal file
41
Dockerfile
Normal file
@@ -0,0 +1,41 @@
|
||||
# Stage 1: Builder
|
||||
FROM python:3.12-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install uv for fast dependency management
|
||||
RUN pip install uv
|
||||
|
||||
# Copy only requirements first to leverage Docker cache
|
||||
COPY requirements.txt .
|
||||
|
||||
# Install dependencies into the system python environment of the builder
|
||||
RUN uv pip install --system -r requirements.txt
|
||||
|
||||
# Stage 2: Final Image
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install curl for health checks
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy installed packages from builder
|
||||
COPY --from=builder /usr/local/lib/python3.12/site-packages/ /usr/local/lib/python3.12/site-packages/
|
||||
COPY --from=builder /usr/local/bin/ /usr/local/bin/
|
||||
|
||||
# Copy application code
|
||||
COPY src/ ./src/
|
||||
COPY pyproject.toml .
|
||||
COPY README.md .
|
||||
|
||||
# Set Python path to find the package
|
||||
ENV PYTHONPATH=/app/src
|
||||
|
||||
# Default port
|
||||
EXPOSE 8000
|
||||
|
||||
# Run the server
|
||||
CMD ["python", "src/monarch_mcp_custom/server.py"]
|
||||
Reference in New Issue
Block a user