Introduction
In this project, I worked on a microservice based application and focused on making it production ready using Docker and CI/CD pipelines.
Instead of just running the application locally, the goal was to:
- Understand how multiple services interact
- Package them using Docker
- Orchestrate them with Docker Compose
- Automate testing, security checks, and deployment using GitHub Actions
This article explains how to run, test, and deploy the project from scratch.
Project Repository
GitHub Repo: https://github.com/AnitaAliCloud/hng14-stage2-devops
System Architecture
The system consists of four main components:
- Frontend (Node.js) — user interface for submitting jobs
- Backend API (FastAPI) — handles job creation and status
- Worker Service (Python) — processes jobs asynchronously
- Redis — message broker between services
Flow Diagram:
Frontend → API → Redis Queue → Worker → Redis → API → Frontend
Prerequisites
Before running this project, ensure you have:
- Docker installed → https://docs.docker.com/get-docker/
- Docker Compose installed
- Git installed
- (Optional) Node.js and Python for local debugging
How to Run the Project Locally
1. Clone the repository
git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git
cd YOUR_REPO
2. Set up environment variables
Create a .env file:
cp .env.example .env
Update values if needed.
3. Start all services with Docker Compose
docker-compose up --build
4. Access the application
- Frontend: http://localhost:3000
- API: http://localhost:8000
- Redis: internal only (not exposed)
Running Health Checks
Each service includes a health endpoint:
-
/health→ API health status - Docker health checks ensure services restart automatically if unhealthy
CI/CD Pipeline (GitHub Actions)
The project includes an automated pipeline:
Pipeline stages:
- Lint (flake8, eslint, hadolint)
- Test (unit tests with pytest)
- Build Docker images
- Security scan (Trivy)
- Integration tests
- Deployment
CI/CD Workflow Screenshot:
Running Tests Locally
To run tests manually:
pytest
For coverage report:
pytest --cov=app
Security Checks
The pipeline includes:
- Docker image scanning with Trivy
- Failing builds on critical vulnerabilities
- No secrets stored in images or repository
Troubleshooting
Containers not starting?
Check logs:
docker-compose logs -f
Port already in use?
sudo lsof -i :3000
Key Learnings
This project helped reinforce:
- How microservices communicate in real systems
- Why containerization improves reliability
- Importance of CI/CD automation
- How infrastructure impacts application behavior
Conclusion
This project demonstrates how a multi-service application can be containerized, tested, and deployed in a structured and repeatable way.
Beyond just writing code, the focus was on building a system that can be reliably shipped and maintained.
Useful Links
- GitHub Repository: https://github.com/AnitaAliCloud/hng14-stage2-devops
- CI/CD Pipeline: (GitHub Actions tab in repo)

Top comments (0)