Skip to content

Commit 1b455d1

Browse files
committed
feat(mcp): add Dockerfile for remote streamable-http deployment
1 parent 1c5b085 commit 1b455d1

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

surfsense_mcp/.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.git
2+
.gitignore
3+
.venv
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
*.so
8+
.pytest_cache/
9+
.ruff_cache/
10+
.env
11+
tests/

surfsense_mcp/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# syntax=docker.io/docker/dockerfile:1
2+
# SurfSense MCP Server — remote (streamable-http) image.
3+
# Serves /mcp (per-request API key, no baked secret) and a public /health probe.
4+
5+
# Stage 1: deps frozen from uv.lock so rebuilds never drift.
6+
FROM python:3.12-slim AS deps
7+
8+
WORKDIR /app
9+
10+
COPY pyproject.toml uv.lock ./
11+
RUN pip install --no-cache-dir uv && \
12+
uv export --frozen --no-dev --no-emit-project --no-hashes \
13+
--format requirements-txt -o /tmp/requirements.txt && \
14+
uv pip install --system --no-cache-dir -r /tmp/requirements.txt && \
15+
rm /tmp/requirements.txt
16+
17+
18+
# Stage 2: project source; --no-deps since deps are already installed above.
19+
FROM deps AS production
20+
21+
COPY . .
22+
RUN uv pip install --system --no-cache-dir --no-deps -e .
23+
24+
ENV PYTHONUNBUFFERED=1 \
25+
SURFSENSE_MCP_TRANSPORT=streamable-http \
26+
SURFSENSE_MCP_HOST=0.0.0.0 \
27+
SURFSENSE_MCP_PORT=8080 \
28+
SURFSENSE_BASE_URL=https://api.surfsense.com
29+
30+
EXPOSE 8080
31+
32+
CMD ["python", "-m", "surfsense_mcp"]

0 commit comments

Comments
 (0)