Docker Deployment

This guide covers deploying gitlab-summary using Docker and docker-compose.


Quick Start

  1. Create .env file:
  cat > .env << EOF
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
GITLAB_URL=https://gitlab.example.com
GITLAB_GROUP=your-group-id
GITLAB_SINCE=24h
GITLAB_PORT=5100
GITLAB_INTERVAL=30
GH_TOKEN=github_pat_your_token_here
COPILOT_MODEL=claude-sonnet-4-5
EOF
  
  1. Create docker-compose.yml:
  services:
  gitlab-summary:
    image: garrardkitchen/gitlab-summary:latest
    container_name: gitlab-summary
    ports:
      - "5100:5100"
    environment:
      - GITLAB_GROUP=${GITLAB_GROUP}
      - GITLAB_URL=${GITLAB_URL}
      - GITLAB_TOKEN=${GITLAB_TOKEN}
      - GITLAB_SINCE=${GITLAB_SINCE:-24h}
      - GITLAB_PORT=${GITLAB_PORT:-5100}
      - GITLAB_INTERVAL=${GITLAB_INTERVAL:-30}
      - GH_TOKEN=${GH_TOKEN:-}
      - COPILOT_MODEL=${COPILOT_MODEL:-claude-sonnet-4-5}
    volumes:
      - gitlab-summary-data:/home/ubuntu/.local/share/gitlab-summary
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5100/api/version"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 10s

volumes:
  gitlab-summary-data:
    driver: local
  
  1. Start the service:
  docker-compose up -d
  
  1. Access the dashboard:

Open http://localhost:5100 in your browser.


Using docker run

Linux/Windows - Named Volume

Docker manages the storage location:

  docker run -d \
  --name gitlab-summary \
  -p 5100:5100 \
  -e GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx" \
  -e GITLAB_URL="https://gitlab.example.com" \
  -e GITLAB_GROUP="your-group-id" \
  -e GITLAB_SINCE="24h" \
  -e GITLAB_PORT="5100" \
  -e GITLAB_INTERVAL="30" \
  -e GH_TOKEN="github_pat_your_token_here" \
  -e COPILOT_MODEL="claude-sonnet-4-5" \
  -v gitlab-summary-data:/home/ubuntu/.local/share/gitlab-summary \
  --restart unless-stopped \
  garrardkitchen/gitlab-summary:latest
  

macOS - Bind Mount

Store data in a specific directory:

  docker run -d \
  --name gitlab-summary \
  -p 5100:5100 \
  -e GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx" \
  -e GITLAB_URL="https://gitlab.example.com" \
  -e GITLAB_GROUP="your-group-id" \
  -e GITLAB_SINCE="24h" \
  -e GITLAB_PORT="5100" \
  -e GITLAB_INTERVAL="30" \
  -e GH_TOKEN="github_pat_your_token_here" \
  -e COPILOT_MODEL="claude-sonnet-4-5" \
  -v ~/.gitlab-summary:/home/ubuntu/.local/share/gitlab-summary \
  --restart unless-stopped \
  garrardkitchen/gitlab-summary:latest
  

Access the dashboard at: http://localhost:5100


Environment Variables

VariableDescriptionDefaultRequired
GITLAB_GROUPGitLab group ID or path-✅ Yes
GITLAB_URLGitLab instance URL-✅ Yes
GITLAB_TOKENGitLab Personal Access Token (read_api scope)-✅ Yes
GITLAB_SINCETime range (e.g., 1h, 24h, 2d, 7d)24hNo
GITLAB_PORTServer port5100No
GITLAB_INTERVALRefresh interval in seconds30No
GH_TOKENGitHub Fine-grained PAT for Copilot AI-No*

* Required only for AI-powered failure analysis. Must have active GitHub Copilot subscription.


Token Setup

GitLab Token

  1. Go to GitLab → SettingsAccess Tokens
  2. Create new token with:
    • Name: gitlab-summary
    • Scopes: read_api
    • Expiration: Set as needed
  3. Copy the token (format: glpat-xxxxxxxxxxxxxxxxxxxx)

GitHub Token (Optional - for AI Analysis)

  1. Go to https://github.com/settings/tokens?type=beta
  2. Click “Generate new token”
  3. Configure:
    • Token name: gitlab-summary-copilot
    • Expiration: 90 days (recommended)
    • Account permissionsUser permissions:
      • Copilot Chat: Read ✅
      • User copilot requests: Read ✅
      • Gists: Read and Write ✅
  4. Copy the token (format: github_pat_xxxxxxxxxxxxxxxxxxxx)

Note: You must have an active GitHub Copilot subscription.


Managing the Container

View Logs

  # Follow logs in real-time
docker-compose logs -f

# View last 50 lines
docker-compose logs --tail=50

# View logs for specific service
docker logs gitlab-summary
  

Stop/Start/Restart

  # Stop
docker-compose down

# Start
docker-compose up -d

# Restart
docker-compose restart

# Rebuild and restart (after pulling new image)
docker-compose pull
docker-compose up -d
  

Check Status

  # Check if container is running
docker-compose ps

# Check health status
docker ps --filter name=gitlab-summary

# Test health endpoint
curl http://localhost:5100/api/version
  

Update to Latest Version

  # Pull latest image
docker-compose pull

# Restart with new image
docker-compose up -d

# Verify version
curl http://localhost:5100/api/version
  

Data Persistence

GitLab token data is stored in a Docker volume:

  # List volumes
docker volume ls

# Inspect volume
docker volume inspect gitlab-summary_gitlab-summary-data

# Backup volume (Linux/macOS)
docker run --rm \
  -v gitlab-summary_gitlab-summary-data:/data \
  -v $(pwd):/backup \
  alpine tar czf /backup/gitlab-summary-backup.tar.gz -C /data .

# Restore volume
docker run --rm \
  -v gitlab-summary_gitlab-summary-data:/data \
  -v $(pwd):/backup \
  alpine tar xzf /backup/gitlab-summary-backup.tar.gz -C /data
  

Networking

Custom Port

Change the port mapping in docker-compose.yml or with -p:

  ports:
  - "8080:5100"  # Access on port 8080
  

Or with docker run:

  docker run -d -p 8080:5100 ...
  

Access at: http://localhost:8080

Reverse Proxy

Example nginx configuration:

  server {
    listen 80;
    server_name gitlab-summary.example.com;

    location / {
        proxy_pass http://localhost:5100;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}
  

Troubleshooting

Container Won’t Start

Check logs:

  docker-compose logs
  

Common issues:

  • Missing required environment variables (GITLAB_TOKEN, GITLAB_URL, GITLAB_GROUP)
  • Invalid GitLab token or expired token
  • Port 5100 already in use

Dashboard Not Accessible

Check if container is running:

  docker ps --filter name=gitlab-summary
  

Test health endpoint:

  curl http://localhost:5100/api/version
  

Check port binding:

  docker port gitlab-summary
# Should show: 5100/tcp -> 0.0.0.0:5100
  

AI Analysis Not Working

Check GitHub token:

  docker exec gitlab-summary env | grep GH_TOKEN
  

Common issues:

  • GH_TOKEN not set or incorrect format
  • Token missing required permissions (Copilot Chat, User copilot requests, Gists)
  • No active GitHub Copilot subscription
  • Token expired (Fine-grained PATs have expiration dates)

Test token manually:

  # Set your token
export GH_TOKEN="github_pat_your_token_here"

# Test API access
curl -H "Authorization: token $GH_TOKEN" \
  https://api.github.com/user
  

High Memory Usage

The Copilot CLI binary can use significant memory during analysis. If needed, limit container resources:

  services:
  gitlab-summary:
    # ... other config ...
    deploy:
      resources:
        limits:
          memory: 2G
        reservations:
          memory: 512M
  

Production Deployment

Security Best Practices

  1. Use secrets management:

    • Docker secrets
    • Kubernetes secrets
    • AWS Secrets Manager / Azure Key Vault / GCP Secret Manager
  2. Enable HTTPS:

    • Use reverse proxy (nginx, Traefik, Caddy)
    • Terminate SSL at proxy level
  3. Restrict network access:

    • Use Docker networks
    • Firewall rules for port 5100
    • VPN or private network access only
  4. Regular updates:

    • Pull latest image weekly
    • Monitor for security advisories
    • Set up automated updates in CI/CD

Example Production docker-compose.yml

  services:
  gitlab-summary:
    image: garrardkitchen/gitlab-summary:latest
    container_name: gitlab-summary
    restart: always
    ports:
      - "127.0.0.1:5100:5100"  # Only accessible from localhost
    environment:
      - GITLAB_GROUP=${GITLAB_GROUP}
      - GITLAB_URL=${GITLAB_URL}
      - GITLAB_TOKEN=${GITLAB_TOKEN}
      - GITLAB_SINCE=24h
      - GITLAB_INTERVAL=30
    volumes:
      - gitlab-summary-data:/home/ubuntu/.local/share/gitlab-summary
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5100/api/version"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 10s
    deploy:
      resources:
        limits:
          memory: 2G
        reservations:
          memory: 512M

volumes:
  gitlab-summary-data:
    driver: local
  

Monitoring

Health check endpoint:

  curl http://localhost:5100/api/version
  

Response:

  {
  "version": "0.2.5",
  "status": "healthy"
}
  

Prometheus metrics (if enabled):

  curl http://localhost:5100/metrics
  

Docker Compose Reference

Full Configuration Example

See the complete docker-compose.yml in the repository: https://github.com/garrardkitchen/gitlab-summary/blob/main/docker-compose.yml

Environment File (.env)

See .env.example for a complete template: https://github.com/garrardkitchen/gitlab-summary/blob/main/.env.example


Next Steps