mcnoaa-tides/Dockerfile.mcp
Ryan Malloy ad17d72894 Return HTML charts as EmbeddedResource instead of server-side files
HTML charts were being written to the server filesystem and returning
a path the client couldn't access. Now returns the HTML content
inline as an MCP EmbeddedResource with text/html MIME type, so the
client receives the full interactive chart over the wire.
2026-02-23 19:50:36 -07:00

29 lines
712 B
Docker

# --- Dependencies ---
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS deps
WORKDIR /app
COPY pyproject.toml uv.lock README.md ./
COPY src/ src/
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev --no-editable --extra viz
# --- Runtime ---
FROM python:3.12-slim-bookworm AS runtime
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1
ENV PATH="/app/.venv/bin:$PATH"
ENV MPLCONFIGDIR=/tmp/matplotlib
COPY --from=deps /app/.venv /app/.venv
COPY src/ src/
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import socket; s=socket.create_connection(('127.0.0.1',8000),timeout=3); s.close()" || exit 1
USER nobody
CMD ["mcnoaa-tides"]