# ⚠️ DEPRECATION NOTICE: This Docker image is for the deprecated gitlab_glab MCP server. Use gitlab_python instead. # Multi-stage build for GitLab CLI MCP Server # Stage 1: Build stage FROM python:3.11-slim AS builder # Set working directory WORKDIR /app # Install build dependencies RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ curl \ && rm -rf /var/lib/apt/lists/* # Install uv RUN curl -sSf https://astral.sh/uv/install.sh | sh # Copy project files COPY pyproject.toml README.md ./ COPY src/ ./src/ # Build the package RUN /root/.cargo/bin/uv pip install --no-cache-dir -e . # Stage 2: Runtime stage FROM python:3.11-slim # Set working directory WORKDIR /app # Install GitLab CLI RUN apt-get update && \ apt-get install -y --no-install-recommends \ curl \ ca-certificates \ && rm -rf /var/lib/apt/lists/* # Install glab CLI RUN curl -s https://gitlab.com/gitlab-org/cli/-/raw/main/scripts/install.sh | sh # Create a non-root user RUN useradd -m mcp USER mcp # Create logs directory with proper permissions RUN mkdir -p /app/logs && chown -R mcp:mcp /app/logs # Copy built package from builder stage COPY --from=builder --chown=mcp:mcp /app /app # Set environment variables ENV PYTHONUNBUFFERED=1 # Expose port for remote transport EXPOSE 8080 # Health check HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ CMD curl -f http://localhost:8080/health || exit 1 # Set entrypoint ENTRYPOINT ["python", "-m", "mcp_server_gitlab_glab"] # Default command CMD ["--transport", "remote", "--host", "0.0.0.0", "--port", "8080"]