DEV Community

Sneha Tomar
Sneha Tomar

Posted on

Learning Jenkins by Building a CI/CD Pipeline for a Docker Compose Application

After containerizing a three-tier MERN stack application using Docker Compose, the next natural step in my DevOps learning journey was to automate the build and deployment process.

In Week 4, I focused on learning Jenkins and CI/CD fundamentals and applying them to an already Dockerized application instead of creating something new from scratch. This helped me understand how CI/CD is actually introduced in real-world projects.

Why Jenkins?

  • Manually running Docker commands works when learning containers, but it doesn’t scale.
  • Real systems rely on automation, consistency, and repeatability.
  • Jenkins acts as the bridge between:
  • Source code changes
  • Automated builds
  • Deployment workflows
  • This week was about understanding how Jenkins fits into DevOps pipelines, not just how to click buttons in the UI.

What I Learned

  • During this week, I explored Jenkins from fundamentals to more advanced concepts:
  • Jenkins architecture and CI/CD concepts
  • Jenkins setup and installation
  • Jenkins UI, jobs, and freestyle projects
  • Declarative pipelines and Webhooks
  • Jenkins agents and multi-node architecture
  • Shared libraries and their real-world use cases
  • Role-based user management in Jenkins
  • Email notifications on pipeline success and failure
  • Rather than memorizing features, I focused on why each component exists and when it is used.

Project Overview
To apply these concepts, I integrated Jenkins with my existing three-tier MERN stack application, which is managed using Docker Compose.
The goal was simple:

  • Automate build and deployment without changing application code.

CI/CD Flow Implemented

  • The pipeline follows this workflow:
  • GitHub → Jenkins Pipeline → Docker Compose → Deployment → Verification
  • Jenkins Pipeline Stages
  • Checkout Source Code
  • Jenkins pulls the latest code from GitHub.
  • Deploy Using Docker Compose
  • Stops running containers (if any)
  • Builds Docker images
  • Starts services using Docker Compose
  • Verify Deployment
  • Displays running containers to ensure successful deployment.
  • Email Notifications
  • Sends email alerts on pipeline success or failure.
  • All stages are defined using a Declarative Jenkinsfile, making the pipeline version-controlled and reproducible.

Key Takeaways

  • CI/CD is more about process and reliability than tools
  • Jenkins pipelines scale far better than manual jobs
  • Declarative pipelines improve readability and maintainability
  • CI/CD can be integrated into existing systems without modifying application code
  • Automation reduces human error and speeds up deployments
  • This project helped me move from “running commands manually” to “thinking in pipelines”.

Tech Stack Used

  • Jenkins
  • Docker
  • Docker Compose
  • GitHub
  • Linux

Repository
GitHub: https://github.com/snehatomar1205/DevOps

What’s Next?
My next focus will be on:
YAML fundamentals
Ansible for configuration management and automation
This will help me move further toward infrastructure automation and scalable deployments.

Top comments (0)