Dockerfile•886 B
FROM python:3.13-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip and install mcp and uv
RUN python -m pip install --upgrade pip
RUN pip install mcp
# Install uv (modern Python package manager)
RUN pip install uv
ENV PATH="/root/.local/bin:$PATH"
# Create uv-managed project named mcp-server
RUN uv init mcp-server
# Set new working directory to mcp-server
WORKDIR /app/mcp-server
# Copy main application files
COPY main.py .
COPY pyproject.toml .
COPY requirements.txt .
RUN pip install -r requirements.txt
# Add mcp with CLI extras using uv
RUN uv add "mcp[cli]"
# Expose port
EXPOSE 8000
# Run MCP app via uv in the container
CMD ["uvx", "mcpo", "--port", "8000", "--", "python", "main.py"]