All checks were successful
Build and Push Docker Images / build (push) Successful in 56s
## What changed Fixes the build failure caused by wrong upstream repo URL and missing default branch. ### Dockerfile - **Repo URL**: `opsmill/infrahub-mcp` (was `opsmill/infrahub-mcp-server`) - **Default branch**: clone without `--branch` when `INFRAHUB_MCP_VERSION` is unset, so the upstream default branch is used automatically - **Secrets warning**: removed `ENV INFRAHUB_API_TOKEN=""` — the token should be passed at runtime via `-e`, not baked into the image - **Comments**: rewritten in English ### README - Fixed upstream repo link - Clarified that `INFRAHUB_API_TOKEN` is required at runtime Reviewed-on: #7
38 lines
1.2 KiB
Docker
38 lines
1.2 KiB
Docker
FROM python:3.13-slim
|
|
|
|
# System dependencies for uv and potential wheel builds
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends git ca-certificates curl && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install uv
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
|
|
|
# Clone the upstream MCP server repository
|
|
# Use INFRAHUB_MCP_VERSION to pin a specific tag/branch at build time
|
|
# When left empty, the repo's default branch is used
|
|
ARG INFRAHUB_MCP_VERSION=""
|
|
RUN if [ -n "${INFRAHUB_MCP_VERSION}" ]; then \
|
|
git clone --depth 1 --branch "${INFRAHUB_MCP_VERSION}" \
|
|
https://github.com/opsmill/infrahub-mcp.git /app; \
|
|
else \
|
|
git clone --depth 1 \
|
|
https://github.com/opsmill/infrahub-mcp.git /app; \
|
|
fi
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Python dependencies via uv
|
|
RUN uv sync --frozen --no-dev
|
|
|
|
# Default environment variables
|
|
# INFRAHUB_API_TOKEN should be passed at runtime (not baked into the image)
|
|
ENV INFRAHUB_ADDRESS=http://localhost:8000
|
|
ENV MCP_HOST=0.0.0.0
|
|
ENV MCP_PORT=8001
|
|
|
|
EXPOSE 8001
|
|
|
|
# Run the MCP server in SSE mode (network-accessible)
|
|
ENTRYPOINT ["uv", "run", "fastmcp", "run", "src/infrahub_mcp/server.py:mcp", "--transport", "sse"]
|