Dockerfile•943 B
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 \
PYTHONUNBUFFERED=1
# Copy dependency files
COPY pyproject.toml uv.lock ./
# Install dependencies with sync
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
# Copy application code
COPY main.py ./
COPY src/ ./src/
# Expose port (optional for stdio, required for HTTP transport later if I will add it)
EXPOSE 8000
# Command to run the MCP server
CMD ["uv", "run", "python", "main.py"]