A comprehensive DevOps portfolio showcasing modern CI/CD practices, infrastructure as code, and automated deployment pipelines.
This project demonstrates industry-standard DevOps skills through an end-to-end automated deployment pipeline featuring:
- Simple Node.js Web Application - Express.js with health checks and monitoring endpoints
- Containerization - Docker with optimized multi-stage builds
- CI/CD Pipeline - GitHub Actions with comprehensive testing and deployment
- Infrastructure as Code - Terraform for AWS resource management (coming soon)
- Configuration Management - Ansible for automated server configuration (coming soon)
- Security Scanning - Trivy vulnerability scanning and automated security checks
┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌──────────────┐
│ Developer │───▶│ GitHub │───▶│ GitHub │───▶│ AWS │
│ Commits │ │ Repository │ │ Actions │ │ Infrastructure│
└─────────────┘ └──────────────┘ │ CI/CD │ │ │
└─────────────┘ └──────────────┘
│
▼
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Docker │◀───│ Build & │───▶│ Staging │
│ Registry │ │ Test │ │ Environment│
└─────────────┘ └──────────────┘ └─────────────┘
│
▼
┌──────────────┐
│ Production │
│ Environment │
└──────────────┘
- Node.js 18+ and npm
- Docker and Docker Compose
- Git
- AWS Account (for full deployment)
-
Clone the repository
git clone https://github.com/Gog2006/DevOps_project1.git cd DevOps_project1 -
Install dependencies
npm install
-
Run tests
npm test npm run lint -
Start the application
npm start # Application available at http://localhost:3000
-
Build the Docker image
docker build -t devops-portfolio-app . -
Run with Docker Compose
docker-compose up -d
-
Health check
curl http://localhost:3000/health
npm test # Run all tests
npm test -- --watch # Run tests in watch mode
npm test -- --coverage # Generate coverage reportnpm run lint # Check code style
npm run lint:fix # Auto-fix lint issues# Build and test the container
docker build -t devops-portfolio-app:test .
docker run --rm -p 3000:3000 devops-portfolio-app:test
# Run container health check
docker run --rm devops-portfolio-app:test node healthcheck.jsThe GitHub Actions workflow (.github/workflows/ci-cd.yml) includes:
- ESLint code style checking
- Jest unit tests with coverage reporting
- Security vulnerability scanning with npm audit
- Trivy vulnerability scanner for filesystem
- SARIF upload to GitHub Security tab
- Docker image security analysis
- Multi-architecture Docker builds (AMD64, ARM64)
- GitHub Container Registry publishing
- Image tagging strategy (latest, branch, SHA)
- Build caching for faster builds
- Staging: Automated deployment on develop branch
- Production: Manual approval required on main branch
- AWS credential configuration
- Environment-specific configurations
- Health checks and smoke tests
- End-to-end testing (planned)
- Deployment notifications
DevOps_project1/
├── .github/
│ └── workflows/
│ └── ci-cd.yml # GitHub Actions CI/CD pipeline
├── public/
│ └── index.html # Frontend application
├── tests/
│ └── app.test.js # Unit tests
├── terraform/ # Infrastructure as Code (coming soon)
├── ansible/ # Configuration management (coming soon)
├── app.js # Main application server
├── Dockerfile # Container configuration
├── docker-compose.yml # Local development setup
├── healthcheck.js # Container health check
├── package.json # Node.js dependencies and scripts
├── jest.config.js # Jest testing configuration
├── .eslintrc.json # ESLint configuration
└── README.md # This file
| Component | Technology | Purpose |
|---|---|---|
| Application | Node.js + Express.js | Web server and API |
| Frontend | HTML5 + CSS3 + Vanilla JS | User interface |
| Testing | Jest + Supertest | Unit and integration testing |
| Code Quality | ESLint | Code linting and formatting |
| Containerization | Docker + Docker Compose | Application packaging |
| CI/CD | GitHub Actions | Automated testing and deployment |
| Security | Trivy + npm audit | Vulnerability scanning |
| Cloud | AWS (planned) | Infrastructure hosting |
| IaC | Terraform (planned) | Infrastructure provisioning |
| Config Mgmt | Ansible (planned) | Server configuration |
GET /- Main application pageGET /health- Health check endpointGET /api/info- Application information and version
{
"status": "healthy",
"timestamp": "2024-02-05T10:30:00.000Z",
"version": "1.0.0"
}The application includes built-in Docker health checks:
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node healthcheck.js- Helmet.js - Security headers middleware
- Non-root container user - Enhanced container security
- Dependency scanning - Automated vulnerability detection
- Code scanning - SARIF integration with GitHub Security
- Secrets management - Environment-based configuration
NODE_ENV=development
PORT=3000NODE_ENV=production
PORT=3000environment:
- NODE_ENV=production
- PORT=3000- Automated testing on every push
- Docker image building and publishing
- Manual production deployments
- Blue-green deployments
- Rolling updates with zero downtime
- Automated rollback capabilities
- Infrastructure scaling
-
Feature Development
git checkout -b feature/new-feature npm run dev # Start development server npm test -- --watch # Run tests in watch mode
-
Testing & Quality Assurance
npm run lint # Check code style npm test # Run all tests docker-compose up # Test with Docker
-
Deployment
git push origin feature/new-feature # Create pull request # GitHub Actions runs CI pipeline # Merge to develop for staging deployment # Merge to main for production deployment
Port already in use
lsof -ti:3000 | xargs killDocker build failures
docker system prune -a # Clean up Docker cache
docker build --no-cache -t devops-portfolio-app .Test failures
npm test -- --verbose # Detailed test output
npm test -- --detectOpenHandles # Debug hanging testsApplication logs
npm start 2>&1 | tee app.logDocker logs
docker logs $(docker ps -q --filter ancestor=devops-portfolio-app)This project is designed to be AWS Free Tier compatible:
- EC2 t2.micro: $0 (free tier)
- Application Load Balancer: ~$16/month
- Route 53: ~$0.50/month
- S3: ~$1-3/month
- Total estimated: ~$17-20/month
docker-compose down -v
docker system prune -a
npm run clean # If availableterraform destroyThis project showcases the following DevOps competencies:
- Version Control: Git workflows and branching strategies
- Containerization: Docker and Docker Compose
- CI/CD Pipelines: GitHub Actions automation
- Testing: Unit tests, integration tests, and code coverage
- Code Quality: Linting, formatting, and security scanning
- Monitoring: Health checks and application observability
- Infrastructure as Code: Terraform (in progress)
- Configuration Management: Ansible (in progress)
- Cloud Deployment: AWS services (planned)
- Orchestration: Kubernetes (advanced phase)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Project Link: https://github.com/Gog2006/DevOps_project1
Built for DevOps Excellence