Docker Compose Generator is a production-ready web portal for creating secure docker-compose files. It integrates Docker Hub catalog browsing, automated security vulnerability scanning, misconfiguration detection, and intelligent version recommendations - ensuring safe deployments before file download.
- Pre-Download Security: Scan images for vulnerabilities BEFORE allowing download
- Misconfiguration Prevention: Detect port conflicts, missing env vars, resource issues
- Alternative Suggestions: Recommend safer image versions when vulnerabilities found
- Docker Hub Integration: Real-time catalog fetching from Docker Hub
- Intelligent Blocking: Prevent downloads with critical security issues
Location: /frontend
Responsibilities:
- Service catalog browser (Docker Hub integration)
- Docker Compose visual builder
- Security scan dashboard
- Misconfiguration warnings display
- Alternative version suggestions UI
- Download eligibility checker
Key Technologies: React 19, TypeScript, Tailwind CSS 4, React Router 7, Vite
Location: /backend
Responsibilities:
- Docker Hub API integration
- Coordinate security scanning
- Aggregate validation results
- Compose file generation
- Download eligibility determination
- Template management
Key Technologies: Node.js, Express, MongoDB, Winston, Express Rate Limit
Location: /services/security-scanner
Port: 8001
Responsibilities:
- CVE vulnerability scanning (Trivy integration)
- Severity assessment (Critical/High/Medium/Low)
- Version comparison
- Alternative version suggestions
- Download blocking decisions
Location: /services/config-validator
Port: 8003
Responsibilities:
- Port conflict detection
- Environment variable validation
- Resource constraint checks
- Volume mount validation
- Network configuration checks
- Dependency analysis
Location: /services/template-generator
Port: 8002
Responsibilities:
- Pre-built template management
- Template CRUD operations
- Custom template generation
- Template validation
1. User browses Docker Hub catalog → Frontend
2. Frontend requests service list → Backend API
3. Backend fetches from Docker Hub API
4. User selects services and versions
5. User builds compose configuration
6. User requests download
7. Backend triggers security scan → Security Scanner
8. Backend triggers validation → Config Validator
9. Backend aggregates results
10. If PASS: Generate and return compose file
11. If FAIL: Show issues + alternatives
1. Security Scanner receives image list
2. For each image:
- Fetch image metadata
- Run Trivy vulnerability scan
- Classify vulnerabilities by severity
- Query for alternative versions
- Scan alternatives
3. Generate recommendation:
- BLOCK if critical vulnerabilities
- WARN if high/medium vulnerabilities
- SUGGEST alternative versions
4. Return results to Backend API
1. Config Validator receives compose config
2. Port Conflict Check:
- Extract all port mappings
- Identify duplicates
- Suggest alternatives
3. Environment Variable Check:
- Identify service type
- Lookup required env vars
- Flag missing variables
4. Resource Check:
- Validate limits and reservations
- Check total resource allocation
5. Return validation report
GET /api/catalog/search- Search imagesGET /api/catalog/image/:name- Get image detailsGET /api/catalog/image/:name/tags- Get versions
POST /api/security/scan- Scan imagesPOST /api/security/check-eligibility- Check download eligibilityGET /api/security/alternatives/:image/:tag- Get safer versions
POST /api/validation/check- Validate configurationPOST /api/validation/ports- Check port conflictsPOST /api/validation/environment- Check env vars
POST /api/compose/generate- Generate compose filePOST /api/compose/validate- Validate compose config
POST /scan/image- Scan single imagePOST /scan/batch- Scan multiple imagesGET /alternatives/{image}/{tag}- Get safer versionsPOST /check-eligibility- Check download eligibility
POST /validate/compose- Validate complete configPOST /validate/ports- Check port conflictsPOST /validate/environment- Validate env varsPOST /validate/resources- Check resources
GET /templates- List templatesPOST /templates- Create templatePOST /templates/generate- Generate custom template
{
_id: ObjectId,
name: String,
description: String,
category: String,
services: Object,
networks: Object,
volumes: Object,
tags: [String],
version: String,
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
imageHash: String, // Hash of image:tag for fast lookup
imageName: String,
imageTag: String,
scanResults: Object,
expiresAt: Date,
createdAt: Date
}{
_id: ObjectId,
ip: String,
endpoint: String,
timestamp: Date,
requestCount: Number
}CREATE TABLE scan_results (
id SERIAL PRIMARY KEY,
scan_id VARCHAR(255) UNIQUE,
image_name VARCHAR(255),
image_tag VARCHAR(255),
critical_count INTEGER,
high_count INTEGER,
medium_count INTEGER,
low_count INTEGER,
vulnerabilities JSONB,
alternatives JSONB,
recommendation TEXT,
scan_date TIMESTAMP,
created_at TIMESTAMP
);- Rate Limiting: IP-based request throttling to prevent abuse
- Anonymous users: 10 scans per hour
- Sliding window algorithm
- Per-endpoint rate limits
- CORS Protection: Configured allowed origins and methods
- Input Validation: Strict sanitization of all inputs
- Schema validation with Joi/Zod
- YAML/JSON parsing limits
- Image name format validation
- HTTPS Only: Encrypted communication in production
- Request Size Limits: Prevent large payload attacks
- XSS Protection: Content Security Policy headers
- API Key for Microservices: Shared secrets for inter-service communication
- Audit Logging: Track all scans and validation requests
- Local Docker Compose setup
- Hot reload for all services
- Shared network for inter-service communication
- Kubernetes deployment
- Horizontal pod autoscaling
- Load balancing
- Service mesh for communication
- Centralized logging (ELK)
- Monitoring (Prometheus + Grafana)
- Project structure
- Documentation
- Technology stack selection
- API design
- Architecture design
- Frontend basic setup (React 19 + Vite)
- Service implementations
- API development
- Docker Hub API integration
- Trivy scanner integration
- Port conflict detection
- Environment variable validation
- Alternative version suggestion engine
- Complete UI implementation
- Testing suite
- CI/CD pipeline
- Production deployment
- Caching: Redis for scan results and Docker Hub responses
- Parallel Processing: Concurrent image scanning
- Database Indexing: Fast queries on scan results
- Rate Limiting: Respect Docker Hub API limits
- Async Processing: Background jobs for long-running scans
- CDN: Static asset delivery
- Health Checks:
/healthendpoints on all services - Metrics: Prometheus metrics collection
- Logging: Centralized logging with ELK stack
- Tracing: Distributed tracing with Jaeger
- Alerts: PagerDuty/Slack for critical issues
- Dashboards: Grafana for visualization