docker-compose.yaml•2.09 kB
services:
# Streamable HTTP Server mode (default - multi-client support)
mcp-gitlab-http:
build:
context: .
dockerfile: Dockerfile
container_name: mcp-gitlab-http-server
environment:
- NODE_ENV=production
- PORT=3000
ports:
- "3001:3000"
restart: unless-stopped
# Mount a volume for logs if needed
# volumes:
# - ./logs:/app/logs
# Resource limits
deploy:
resources:
limits:
memory: 256M
cpus: '0.5'
reservations:
memory: 128M
cpus: '0.25'
# Health check
healthcheck:
test: ["CMD", "/nodejs/bin/node", "-e", "const http = require('http'); const req = http.request('http://localhost:3000/health', {timeout: 5000}, (res) => { process.exit(res.statusCode === 200 ? 0 : 1); }); req.on('error', () => process.exit(1)); req.on('timeout', () => process.exit(1)); req.end();"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# MCP Server mode (for traditional MCP usage)
mcp-gitlab-mcp:
build:
context: .
dockerfile: Dockerfile
container_name: mcp-gitlab-mcp-server
environment:
- GITLAB_API_TOKEN=${GITLAB_API_TOKEN}
- GITLAB_API_URL=${GITLAB_API_URL:-https://gitlab.com/api/v4}
- NODE_ENV=production
command: [ "node", "build/index.js" ]
profiles:
- mcp
# Resource limits
deploy:
resources:
limits:
memory: 256M
cpus: '0.5'
reservations:
memory: 128M
cpus: '0.25'
# Health check
healthcheck:
test: [ "CMD", "node", "-e", "process.exit(0)" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Optional: Add nginx reverse proxy for production
# nginx:
# image: nginx:alpine
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
# - ./ssl:/etc/nginx/ssl:ro
# depends_on:
# - mcp-gitlab-http
# restart: unless-stopped
# profiles:
# - production