Deploy Multi-Provider Code Review in your own infrastructure using Docker.
- Clone the repository:
git clone https://github.com/keithah/multi-provider-code-review.git
cd multi-provider-code-review- Create environment file:
cp .env.example .envEdit .env with your configuration:
# Required
GITHUB_TOKEN=ghp_your_github_token_here
OPENROUTER_API_KEY=sk-or-v1-your-key-here
# Optional - Feature configuration
REVIEW_PROVIDERS=openrouter/google/gemini-2.0-flash-exp:free,openrouter/mistralai/devstral-2512:free
ANALYTICS_ENABLED=true
LEARNING_ENABLED=true
INCREMENTAL_ENABLED=true- Start the service:
docker-compose up -d- Check logs:
docker-compose logs -f multi-provider-review- View analytics:
# Access the container
docker exec -it mpr-review sh
# Generate analytics dashboard
node dist/cli/index.js analytics generate
# View reports
ls -la reports/docker build -t multi-provider-review:latest .docker run -d \
--name mpr-review \
--restart unless-stopped \
-e GITHUB_TOKEN=ghp_your_token \
-e OPENROUTER_API_KEY=sk-or-v1-your-key \
-v mpr-cache:/app/.cache \
-v $(pwd)/reports:/app/reports \
multi-provider-review:latestEnable webhook server to automatically review PRs on GitHub events.
Uncomment the webhook service:
mpr-webhook:
build:
context: .
dockerfile: Dockerfile
container_name: mpr-webhook
restart: unless-stopped
command: ["node", "dist/server/index.js"]
environment:
- GITHUB_TOKEN=${GITHUB_TOKEN}
- WEBHOOK_SECRET=${WEBHOOK_SECRET}
- PORT=3000
ports:
- "3000:3000"
volumes:
- mpr-cache:/app/.cache
networks:
- mpr-networkruby -rsecurerandom -e 'puts SecureRandom.hex(20)'Add to .env:
WEBHOOK_SECRET=your_generated_secret_here- Go to your repository → Settings → Webhooks → Add webhook
- Payload URL:
https://your-domain.com/webhook - Content type:
application/json - Secret: Your webhook secret from above
- Events: Select "Pull requests"
- Click "Add webhook"
docker-compose up -d mpr-webhook# Check webhook health
curl http://localhost:3000/health
# View logs
docker-compose logs -f mpr-webhook| Variable | Required | Default | Description |
|---|---|---|---|
GITHUB_TOKEN |
✅ | - | GitHub personal access token |
OPENROUTER_API_KEY |
✅ | - | OpenRouter API key |
REVIEW_PROVIDERS |
❌ | See defaults | Comma-separated provider list |
ANALYTICS_ENABLED |
❌ | true |
Enable analytics collection |
ANALYTICS_MAX_REVIEWS |
❌ | 1000 |
Max reviews to store |
LEARNING_ENABLED |
❌ | true |
Enable feedback learning |
INCREMENTAL_ENABLED |
❌ | true |
Enable incremental review |
GRAPH_ENABLED |
❌ | true |
Enable code graph analysis |
QUIET_MODE_ENABLED |
❌ | false |
Enable quiet mode filtering |
PLUGINS_ENABLED |
❌ | false |
Enable custom provider plugins |
PLUGIN_DIR |
❌ | ./plugins |
Plugin directory path |
WEBHOOK_SECRET |
❌ | - | GitHub webhook secret (webhook mode) |
PORT |
❌ | 3000 |
Webhook server port |
LOG_LEVEL |
❌ | info |
Log level (debug, info, warn, error) |
# Enable all advanced features
ENABLE_AST_ANALYSIS=true
ENABLE_SECURITY=true
ENABLE_CACHING=true
INCREMENTAL_ENABLED=true
LEARNING_ENABLED=true
GRAPH_ENABLED=true
ANALYTICS_ENABLED=true# Use specific free providers
REVIEW_PROVIDERS=openrouter/google/gemini-2.0-flash-exp:free,openrouter/mistralai/devstral-2512:free
# Limit number of providers
PROVIDER_LIMIT=3
# Set budget limit (USD)
BUDGET_MAX_USD=1.0Reviews and learning data are stored in a Docker volume:
# Inspect cache
docker volume inspect mpr-cache
# Backup cache
docker run --rm -v mpr-cache:/data -v $(pwd):/backup alpine tar czf /backup/mpr-cache-backup.tar.gz -C /data .
# Restore cache
docker run --rm -v mpr-cache:/data -v $(pwd):/backup alpine tar xzf /backup/mpr-cache-backup.tar.gz -C /dataAnalytics reports are saved to ./reports/:
ls -la reports/
# analytics-dashboard.html
# analytics-export.csv
# multi-provider-review.sarif
# multi-provider-review.jsonThe Docker container includes health checks:
# Check container health
docker ps
# Manual health check
docker exec mpr-review node -e "console.log('healthy')"# View logs
docker-compose logs -f
# Filter by service
docker-compose logs -f multi-provider-review
docker-compose logs -f mpr-webhook
# Export logs
docker-compose logs > mpr-logs.txtGenerate and view analytics:
# Enter container
docker exec -it mpr-review sh
# Generate HTML dashboard
node dist/cli/index.js analytics generate
# Generate CSV export
node dist/cli/index.js analytics generate --format csv
# View summary
node dist/cli/index.js analytics summaryInstead of .env files, use Docker secrets:
secrets:
github_token:
file: ./secrets/github_token.txt
openrouter_key:
file: ./secrets/openrouter_key.txt
services:
multi-provider-review:
secrets:
- github_token
- openrouter_keyUse a reverse proxy (nginx, Traefik) with SSL certificates:
# docker-compose.yml with Traefik
services:
mpr-webhook:
labels:
- "traefik.enable=true"
- "traefik.http.routers.mpr.rule=Host(`mpr.example.com`)"
- "traefik.http.routers.mpr.tls.certresolver=letsencrypt"Keep services on private network:
networks:
mpr-network:
driver: bridge
internal: true # No external accessSet memory and CPU limits:
services:
multi-provider-review:
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '1'
memory: 1G# Check logs
docker-compose logs multi-provider-review
# Common issues:
# - Missing GITHUB_TOKEN or OPENROUTER_API_KEY
# - Invalid API keys
# - Permission issues with volumes# Check webhook configuration in GitHub
# Verify webhook secret matches
# Check firewall rules
# View webhook deliveries in GitHub settings
# Test locally
curl -X POST http://localhost:3000/webhook \
-H "Content-Type: application/json" \
-H "X-GitHub-Event: pull_request" \
-H "X-Hub-Signature-256: sha256=test" \
-d '{"action":"opened","number":1}'# Increase memory limit
docker-compose up -d --scale multi-provider-review=1 \
--memory 4g multi-provider-review# Clear cache
docker volume rm mpr-cache
docker-compose up -d# Pull updates
git pull origin main
# Rebuild and restart
docker-compose down
docker-compose build --no-cache
docker-compose up -d# Scale up new version
docker-compose up -d --scale multi-provider-review=2
# Wait for health check
sleep 10
# Scale down old version
docker-compose up -d --scale multi-provider-review=1For issues and questions:
- GitHub Issues: https://github.com/keithah/multi-provider-code-review/issues
- Documentation: https://github.com/keithah/multi-provider-code-review/tree/main/docs
MIT License - See LICENSE file for details