DEV Community

Mehran Kader
Mehran Kader

Posted on • Updated on

Need suggestion on how to create a CI/CD pipeline for my dockerized app

Hi all, I've been working as a Python based backend engineer for quite a while and recently I've become obsessed with DevOps and SRE related technology. I have started learning docker and also dockerized my first django app using docker-compose. But now I'm a bit lost on how to make this better.

As far as my limited knowledge goes, I should at least set up a CI/CD pipeline and try for a zero downtime deployment using Kubernetes. However I don't have any clue about any of these things apart from a few names (e.g Ansible, Terraform, Kubernetes, Docker Swarm etc.)

Can any courageous adventurer help this lost wanderer to find his way? :p

Top comments (3)

Collapse
 
manan30 profile image
Manan Joshi

You can use DroneCI, BitBucket Pipelines or GitHub Actions. If you would like to learn more about them or require any kind of help in setting up your pipeline, feel free to reach out to me.

Collapse
 
kmehran1106 profile image
Mehran Kader

Hi! I am currently using Bitbucket Pipelines. What I'm doing right now is this:

image: python:3.6

pipelines:
  branches:
    stage:
      - step:
          name: 'Stage Deployment'
          deployment: 'stage'
          caches:
            - pip
          script:
            - echo "Deploying to Stage - Start"
            - pip install fabric python-decouple
            - fab -c pipelines-fabfile connect stage
            - echo "Deploying to Stage - End"
    master:
      - step:
          name: 'Live Deployment'
          deployment: 'live'
          caches:
            - pip
          script:
            - echo "Deploying to Live - Start"
            - pip install fabric python-decouple
            - fab -c pipelines-fabfile connect live
            - echo "Deploying to Live - End"

Basically I'm using pipelines-fabfile to ssh into my server (like regular fabric) and pull my code from git and restart my docker containers using compose. Although this works but I'm pretty sure this is not the appropriate approach. Can you shed some light on this? It'd be really helpful. Thanks!

Collapse
 
andrewbrown profile image
Andrew Brown 🇨🇦

On AWS you would use CodePipeline in conjunction with EKS