0
0
Dockerdevops~3 mins

Why Deploying from CI/CD pipeline in Docker? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if your app could update itself every time you save your code, without you doing anything?

The Scenario

Imagine you have a website and every time you make a change, you manually copy files to the server, restart services, and check if everything works.

This takes a lot of time and you have to do it carefully every time.

The Problem

Doing deployment by hand is slow and easy to mess up.

You might forget a step, deploy the wrong version, or cause downtime.

It's stressful and wastes your time.

The Solution

Deploying from a CI/CD pipeline automates all these steps.

Once you push your code, the pipeline builds, tests, and deploys your app automatically.

This means faster, safer, and repeatable deployments without manual errors.

Before vs After
Before
scp app.tar.gz user@server:/app
ssh user@server 'tar -xzf /app/app.tar.gz && systemctl restart app'
After
pipeline {
  stages {
    stage('deploy') {
      steps {
        sh 'docker-compose up -d --build'
      }
    }
  }
}
What It Enables

It enables you to deliver updates quickly and reliably, making your users happy and your work easier.

Real Life Example

A team pushes code to GitHub, and their CI/CD pipeline automatically builds a Docker image and deploys it to a cloud server without anyone lifting a finger.

Key Takeaways

Manual deployment is slow and error-prone.

CI/CD pipelines automate building, testing, and deploying.

This leads to faster, safer, and consistent releases.