fix: correct infrahub-mcp Dockerfile and README #7

Merged
Damien merged 2 commits from fix/infrahub-mcp-dockerfile into main 2026-03-15 10:28:04 +00:00
Showing only changes of commit 24b5146056 - Show all commits

View File

@@ -1,30 +1,37 @@
FROM python:3.13-slim
# pendances système pour uv et build éventuel de wheels
# 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/*
# Installer uv
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Cloner le repo MCP server upstream
ARG INFRAHUB_MCP_VERSION=main
RUN git clone --depth 1 --branch ${INFRAHUB_MCP_VERSION} \
https://github.com/opsmill/infrahub-mcp-server.git /app
# 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
# Installer les dépendances Python via uv
# Install Python dependencies via uv
RUN uv sync --frozen --no-dev
# Variables d'environnement par défaut
# Default environment variables
# INFRAHUB_API_TOKEN should be passed at runtime (not baked into the image)
ENV INFRAHUB_ADDRESS=http://localhost:8000
ENV INFRAHUB_API_TOKEN=""
ENV MCP_HOST=0.0.0.0
ENV MCP_PORT=8001
EXPOSE 8001
# Lancer le serveur MCP en mode SSE (accessible via réseau)
# Run the MCP server in SSE mode (network-accessible)
ENTRYPOINT ["uv", "run", "fastmcp", "run", "src/infrahub_mcp/server.py:mcp", "--transport", "sse"]