diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2025-03-28 21:39:04 +0100 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2025-03-28 21:39:04 +0100 |
| commit | 903f0d9ca388533ab44615e414379fa5b305a7d1 (patch) | |
| tree | d4225b3b07e11792d06660b31da97f786b5578e9 /servers/gitlab_glab/Dockerfile | |
| parent | 1745749cd2745c94c3f852e9c02dfde19d8d9c20 (diff) | |
Add basic glab mcp server
Diffstat (limited to 'servers/gitlab_glab/Dockerfile')
| -rw-r--r-- | servers/gitlab_glab/Dockerfile | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/servers/gitlab_glab/Dockerfile b/servers/gitlab_glab/Dockerfile new file mode 100644 index 0000000..db86015 --- /dev/null +++ b/servers/gitlab_glab/Dockerfile @@ -0,0 +1,66 @@ +# 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"] |
