What if your app could update itself every time you save your code, without you doing anything?
Why Deploying from CI/CD pipeline in Docker? - Purpose & Use Cases
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.
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.
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.
scp app.tar.gz user@server:/app
ssh user@server 'tar -xzf /app/app.tar.gz && systemctl restart app'pipeline {
stages {
stage('deploy') {
steps {
sh 'docker-compose up -d --build'
}
}
}
}It enables you to deliver updates quickly and reliably, making your users happy and your work easier.
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.
Manual deployment is slow and error-prone.
CI/CD pipelines automate building, testing, and deploying.
This leads to faster, safer, and consistent releases.