-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 1.59 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (30 loc) · 1.59 KB
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
39
40
FROM python:3.13-slim
# Install curl for Bun install
RUN apt-get update && apt-get install -y --no-install-recommends unzip curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Install Bun for bunx poke tunnel
ENV BUN_INSTALL=/usr/local
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/usr/local/bin:${PATH}"
WORKDIR /app
# Install dependencies first for layer caching
COPY pyproject.toml uv.lock .python-version ./
RUN uv sync --frozen --no-dev --no-install-project
# Copy application code
COPY server.py webwork.py main.py ./
# Sync again to pick up the project itself
RUN uv sync --frozen --no-dev
ENV PORT=3000
# Poke tunnel: name shown in Kitchen (default "Local Dev MCP")
ENV POKE_NAME="Webwork MCP"
# Default logging level for the application; can be overridden at runtime (e.g. LOG_LEVEL=DEBUG)
ENV LOG_LEVEL=INFO
# Set POKE_SHARE=1 or true to create shareable tunnel + QR (--share)
ENV POKE_SHARE=""
# Credentials: mount -v ~/.config/poke:/root/.config/poke; .env: --env-file .env or -v $(pwd)/.env:/app/.env
ENV XDG_CONFIG_HOME=/root/.config
EXPOSE ${PORT}
# Start MCP server; if TUNNEL_MODE is "poke" start the server in background and run bunx poke tunnel,
# otherwise run the server in the foreground (no poke tunnel).
CMD ["/bin/sh", "-c", "if [ \"${TUNNEL_MODE}\" = \"poke\" ]; then uv run fastmcp run server.py:mcp --transport http --port \"${PORT}\" & sleep 3 && exec bunx poke@latest tunnel \"http://127.0.0.1:${PORT}/mcp\" -n \"${POKE_NAME}\"; else exec uv run fastmcp run server.py:mcp --transport http --port \"${PORT}\"; fi"]