Some checks failed
Build and Push Monarch MCP Docker Image / build (push) Failing after 10s
Change from requirements.txt to pyproject.toml as source of truth for dependencies. This ensures pyotp is properly installed in the Docker image when built. Using 'uv pip install -e .' will install the package with all dependencies from pyproject.toml.
42 lines
939 B
Docker
42 lines
939 B
Docker
# Stage 1: Builder
|
|
FROM python:3.12-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install uv for fast dependency management
|
|
RUN pip install uv
|
|
|
|
# Copy pyproject.toml first to leverage Docker cache
|
|
COPY pyproject.toml .
|
|
|
|
# Install dependencies into system python environment of builder
|
|
RUN uv pip install --system -e .
|
|
|
|
# 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 package
|
|
ENV PYTHONPATH=/app/src
|
|
|
|
# Default port
|
|
EXPOSE 8000
|
|
|
|
# Run server
|
|
CMD ["python", "src/monarch_mcp_custom/server.py"]
|