<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by OverSocializingCoder on Medium]]></title>
        <description><![CDATA[Stories by OverSocializingCoder on Medium]]></description>
        <link>https://medium.com/@sid6323?source=rss-a262e1045483------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*mM8r9UClR3MgGm7yRWvaRA.jpeg</url>
            <title>Stories by OverSocializingCoder on Medium</title>
            <link>https://medium.com/@sid6323?source=rss-a262e1045483------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 23:21:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sid6323/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Zero Downtime CI/CD deployment using docker, docker-compose, and Jenkins]]></title>
            <link>https://medium.com/@sid6323/zero-downtime-ci-cd-deployment-using-docker-docker-compose-and-jenkins-3a4b829423b?source=rss-a262e1045483------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a4b829423b</guid>
            <dc:creator><![CDATA[OverSocializingCoder]]></dc:creator>
            <pubDate>Fri, 27 Jan 2023 09:31:10 GMT</pubDate>
            <atom:updated>2023-01-27T09:31:10.766Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s a bright sunny day, you finish coding the next coolest feature and your biggest contribution to the product. But wait, even after perfecting the details to an extent that commit messages do make total sense, you become frustrated, the code you pushed took <strong>45–50 mins to deploy to production</strong>, just to notice a bug that occurred <strong>just on production</strong> and moreover the other developer can’t help in fixing the same because it will take <strong>forever to set up the project</strong> on his/her machine.</p><p>Well, the above-mentioned anecdote is nothing but a summary of another day of the life of a developer of any organization using monolithic DevOps techniques and architecture. Here comes, <strong>docker/containerization to the rescue</strong>. In laymen terms, docker/containerization can be defined as a technique through which we bundle the application and its configuration in a closed box(images) such that the box has predefined ways in which it takes input, gives output and communicates to other containers(bundled applications). If you want to go into details about the core architecture and other advantages of docker here’s a good read.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*r7xnsDRRAadrXV6kZyR-wg.png" /><figcaption>An analogy of docker and real-world docked containers</figcaption></figure><blockquote><strong>THE PROBLEM</strong></blockquote><p>With evolving microservices architecture and different kinds of technology stacks and different kinds of the environment, there arose a few problems which needed to be solved.</p><ol><li><strong>Independent and faster build cycles</strong> for all the microservices.</li><li>Easy setup and <strong>replication of the production environment</strong> at the development stage.</li><li>Making the <strong>application and its configuration independent of the environment</strong>.</li><li><strong>Easy Monitoring and independent scalability</strong> for different microservices.</li><li><strong>Zero downtime deployment</strong> with continuous integration and continuous delivery.</li></ol><blockquote><strong>THE APPROACH/SOLUTION</strong></blockquote><p>Upon exploring different tools like Travis CI, Code pipeline &amp; Code Deploy ( AWS ), Jenkins, Docker swarm, Docker compose, Kubernetes, Amazon ECR and comparing on the basis of pricing, flexibility, Ease-to-setup, and popularity, we decided to go ahead with a stack involving docker, docker-compose, Jenkins and Amazon ECR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ANbcH5hJuNujdT7quLVfXw.jpeg" /><figcaption>Overview of CI/CD pipeline</figcaption></figure><p><strong>STEP 1: Configuration</strong></p><p>The first and foremost task was to c<strong>onfigure how the applications and their configurations can be packaged</strong>, so as to make them independent of build or run environment. To achieve so, a <strong>Dockerfile</strong> was made which involved the commands to build a particular type of application and run them. Some of the typical examples of writing a dockerfile are provided <a href="https://github.com/kstaken/dockerfile-examples">here</a>.</p><p><strong>STEP 2: Packaging and CI/CD Pipeline</strong></p><p>Using the <a href="https://plugins.jenkins.io/blueocean">Blue Ocean</a> Jenkins plugin, CI/CD pipelines were made for different microservices which involved GitHub repositories as the source. This pipeline would involve 3 steps :</p><p>i. Pull: Trigger the pulling of new code from the Github repository.</p><p>ii. Build: Build the project according to the configurations of Dockerfile and pushing to Amazon ECR.</p><p>iii. Deploy: Pull the Docker Image from ECR on the server and deploy it using Docker Compose.</p><p><strong>STEP 3: Zero downtime deployment by using Docker compose</strong></p><p><a href="https://docs.docker.com/compose/">Docker-compose</a> is a tool for defining multiple Docker containers, their environment and there interaction with each other and the outer world and running them. The configurations are provided using a <a href="https://github.com/DataDog/docker-compose-example">YAML file</a>. It is used to pull the image from the ECR Repository and run them. The same Docker-compose file is used to deploy the entire set of applications as two different projects.</p><p>At the time of deployment, the last deployed project is identified and a new project is deployed using the newly pulled images on different ports and traffic is routed to new ports using Nginx reverse proxy. Through this process, the new application/image is deployed without having any downtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*uQQVa3X9qYrkTrQjInVHSA.png" /><figcaption>Zero downtime deployment using docker-compose and Nginx</figcaption></figure><blockquote><strong>Conclusion/Future Prospects</strong></blockquote><p>As Mark Twain said, “Continuous improvement is better than delayed perfection”, and hence We tried to focus on the bare minimum of the problem.</p><p>Through containerizing the applications, using CI/CD pipeline and docker-compose we were able to achieve 60% faster (due to optimal use of docker caching mechanism) and independent builds, Fast and Easy replication of production environment, and zero downtime deployment. The future beholds the use of Kubernetes for easy orchestration and monitoring of containers and deploying the images on clusters. Stay tuned for the next dose of DevOps at townscript. Have a good day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a4b829423b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>