Files
aneurinandClaude Sonnet 5 2e1957281b
Build and push image / build (push) Failing after 42s
Add Docker image bundling mcpo + webfetch-mcp as HTTP/OpenAPI service
Vendors webfetch-mcp (pinned commit, from the code.aneur.in mirror) and
installs a pinned mcpo + mcp SDK version on a Python+Node base, wired
together via a runtime entrypoint script so MCPO_API_KEY can be supplied
at container start rather than baked into the image. Adds a Gitea Actions
workflow to build and push on push to main.

Closes #1

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 15:08:51 +01:00

56 lines
2.2 KiB
Docker

# syntax=docker/dockerfile:1
# Pinned revision of https://code.aneur.in/mirrors/webfetch-mcp (mirror of
# https://github.com/manooll/webfetch-mcp). Bump by updating this SHA once
# the mirror has synced past it; verify server.mjs still only reads
# SEARXNG_BASE / DEBUG / DETAILED_LOG from its environment before bumping.
ARG WEBFETCH_MCP_COMMIT=28135553531780c2a35c65e7c972f114f5e1baa4
# Pinned mcpo release (PyPI). Bump by checking the new version's CLI flags
# still match what entrypoint.sh assumes (--host/--port/--api-key/--).
ARG MCPO_VERSION=0.0.20
# mcpo's own pyproject.toml only requires "mcp>=1.17.0" (unbounded), but its
# lockfile shows it's built/tested against exactly this version. Pinning it
# ourselves avoids pip resolving a newer mcp SDK release whose API mcpo
# doesn't yet support (observed: mcp 2.2.0 renamed an import mcpo 0.0.20
# depends on, breaking startup). When bumping MCPO_VERSION, check the new
# release's uv.lock for its actual tested "mcp" version and update this too.
ARG MCP_SDK_VERSION=1.17.0
FROM python:3.12-slim-bookworm AS vendor
ARG WEBFETCH_MCP_COMMIT
RUN apt-get update && apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://code.aneur.in/mirrors/webfetch-mcp.git /src \
&& cd /src \
&& git checkout "${WEBFETCH_MCP_COMMIT}"
RUN mkdir /vendored \
&& cp /src/server.mjs /src/package.json /src/package-lock.json /src/LICENSE /vendored/
FROM python:3.12-slim-bookworm
ARG MCPO_VERSION
ARG MCP_SDK_VERSION
# Node.js 22, matching the version mcpo's own official image is built and
# tested against (webfetch-mcp only requires >=18).
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
gnupg \
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir "mcpo==${MCPO_VERSION}" "mcp==${MCP_SDK_VERSION}"
COPY --from=vendor /vendored /app/webfetch-mcp
WORKDIR /app/webfetch-mcp
RUN npm ci --omit=dev
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["/entrypoint.sh"]