Deployment instructions for GitLab Issues Analyzer.
- Docker and Docker Compose installed
.envfile configured with all required variables
# Start the application
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the application
docker-compose down# Build and start
docker-compose up -d --build
# View logs
docker-compose logs -f
# Restart
docker-compose restartFor development with live code reloading:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml upCode changes are automatically picked up without rebuilding the container.
The docker-compose.yml includes:
- Automatic restart policy
- Data volume persistence (
./data) - Health checks
- Environment variable loading from
.env - Port mapping for dashboard/webhook (default: 8000)
The application exposes a health endpoint:
curl http://localhost:8000/healthResponse:
{
"status": "healthy",
"service": "GitLab Issues Analyzer",
"version": "1.0.0"
}The Dockerfile includes a health check that verifies the application is running:
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python3 -c "import sys; sys.exit(0)" || exit 1- Check logs:
docker-compose logs - Verify all required environment variables are set
- Check for configuration errors in logs
- Verify
GITLAB_URLandGITLAB_TOKENare correct - Check token has
apiscope - Verify network connectivity
- Verify SMTP credentials
- For Gmail, use App Password (not regular password)
- Check firewall rules for SMTP port (587 or 465)
- Verify
SMTP_HOSTandSMTP_PORTare correct
- Verify port is exposed (default: 8000)
- Check
WEBHOOK_PORTmatches exposed port - Check firewall rules
- Verify container is running:
docker-compose ps
-
View logs:
docker-compose logs -f
-
Execute commands in container:
docker-compose exec gitlab-issues-analyzer /bin/bash -
Test configuration:
docker run --rm --env-file .env gitlab-issues-analyzer:latest \ python3 -c "from src.config import load_config, validate_config; \ config = load_config(); validate_config(config); print('✓ Config valid')"
-
Check dashboard:
- Open
http://localhost:8000in browser - View statistics and test manual trigger
- Open
- Use secrets management (Docker secrets, Kubernetes secrets, etc.)
- Never commit
.envfiles to version control - Use non-root user in containers (already configured)
- Enable TLS/SSL for SMTP
- Set up log aggregation for production
- Monitor container health via health checks
- Set up alerts for failures
- Monitor API usage and costs
- Backup
data/analysis_cache.json(contains processed issues and analysis results) - Keep
.envbackups (securely stored, never in version control) - Document deployment procedures
- Use version tags for Docker images
- Test updates in staging first
- Have rollback procedures ready
- Review changelog before updating
Follow the standard Docker deployment instructions above. Works identically across platforms.
The application can be deployed to any platform that supports Docker:
- AWS ECS/Fargate: Use Docker image
- Google Cloud Run: Use Docker image
- Azure Container Instances: Use Docker image
- DigitalOcean App Platform: Use Docker image
- Heroku: Use Docker buildpack
Deploy using standard Kubernetes manifests:
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitlab-issues-analyzer
spec:
replicas: 1
selector:
matchLabels:
app: gitlab-issues-analyzer
template:
metadata:
labels:
app: gitlab-issues-analyzer
spec:
containers:
- name: analyzer
image: gitlab-issues-analyzer:latest
envFrom:
- secretRef:
name: gitlab-analyzer-secrets
ports:
- containerPort: 8000After deployment:
- Verify health endpoint responds
- Test manual trigger via dashboard
- Monitor logs for first few issue analyses
- Set up monitoring and alerts
- Configure backups