-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 985 Bytes
/
Dockerfile
File metadata and controls
38 lines (28 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM python:3.12-slim
WORKDIR /app
# Environment variables
ENV UV_COMPILE_BYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
# MCP server defaults for HTTP transports
MCP_HOST=0.0.0.0 \
MCP_PORT=8000
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Copy dependency files first for better caching
COPY pyproject.toml uv.lock ./
# Install dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev --no-editable
# Copy source code
COPY src/ src/
ENV PATH="/app/.venv/bin:$PATH"
# Default port for HTTP transports
EXPOSE 8000
# Default transport is stdio for MCP compatibility
# Override with --transport streamable-http or --transport sse for HTTP modes
ENTRYPOINT ["uv", "run", "src/server.py"]
# Default arguments (can be overridden)
# For stdio (default MCP transport): no args needed
# For HTTP: --transport streamable-http
CMD ["--transport", "stdio"]