<?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"><channel><title><![CDATA[Django todo app deployment on docker ]]></title><description><![CDATA[Django todo app deployment on docker ]]></description><link>https://harishgaikwad.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 04 Nov 2026 21:12:10 GMT</lastBuildDate><atom:link href="https://harishgaikwad.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA["Effortless Deployment: Running Django todo Web Applications in Docker Containers"]]></title><description><![CDATA[Why should one use Docker to deploy apps? Docker works as a container for your apps. You can build apps, containerize them with Docker and run them…]]></description><link>https://harishgaikwad.hashnode.dev/effortless-deployment-running-django-todo-web-applications-in-docker-containers</link><guid isPermaLink="true">https://harishgaikwad.hashnode.dev/effortless-deployment-running-django-todo-web-applications-in-docker-containers</guid><category><![CDATA[Docker]]></category><category><![CDATA[containers]]></category><category><![CDATA[Django]]></category><category><![CDATA[Ubuntu]]></category><category><![CDATA[GitHub]]></category><dc:creator><![CDATA[Harish Gaikwad]]></dc:creator><pubDate>Mon, 10 Apr 2023 04:29:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1681069581945/1c100238-d7b7-40cb-8ab2-05c4bee701ff.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Why should one use Docker to deploy apps?</p>
<p>Docker works as a container for your apps. You can build apps, containerize them with Docker and run them anywhere. Dockerized apps run on any OS, starting from Windows to Linux. So, you can build your app and share the code across data centers, VMs and cloud service providers easily. This improves testability and speeds up the deployment process.</p>
<p>Docker manages the dependencies of your app and runs as an isolated process. Technically speaking, it consumes fewer resources than VMs and is usually faster and more performant.<a target="_blank" href="https://hashnode.com/post/why-should-one-use-docker-to-deploy-apps-ciibz8duk006oj3xt1qc8cbp4">  
</a></p>
<p><strong>Let's try to build a Django-todo list web-based application which will be running on a docker container.</strong></p>
<ul>
<li>Launched an EC2 instance on AWS and installed Ubuntu and Update it</li>
</ul>
<pre><code class="lang-plaintext">apt-get update
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681063970435/f75d944a-b751-4ba8-a250-055edc7327bf.png" alt class="image--center mx-auto" /></p>
<ul>
<li>Install Docker on the Ubuntu server.</li>
</ul>
<pre><code class="lang-plaintext">apt-get install docker.io
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681064173726/ac6ce4a9-18c2-4bd6-b5db-2b912b2a1034.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p>Make sure the docker service is running on the server.</p>
<pre><code class="lang-plaintext">  systemctl status docker
</code></pre>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681064369922/ab552a45-37a1-42f6-a596-dda478c25221.png" alt class="image--center mx-auto" /></p>
<ul>
<li>Create a project directory</li>
</ul>
<pre><code class="lang-plaintext">mkdir project_django_todo
cd project_django_todo/
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681064710479/93af2415-4a9d-43a6-a334-bc23562f3719.png" alt class="image--center mx-auto" /></p>
<ul>
<li>Clone the django_todo list repository, which contains all the Code files which will be required to host the Web application.</li>
</ul>
<pre><code class="lang-plaintext">git clone https://github.com/harishgaikwad855/django-todo.git
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681064902672/97169392-3c0d-4179-898f-b7485f47627c.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p>Get familiar with the contents of the folder and open the Dockerfile</p>
</li>
<li><p>A Dockerfile is a script that contains instructions for building a Docker image. It specifies the application, its dependencies, and runtime configuration.</p>
</li>
</ul>
<pre><code class="lang-plaintext">vi Dockerfile
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681065247292/13045722-506f-47ef-8366-951d65864fba.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p>Now it's time to play with Docker. Create a Docker image from the Docker file.</p>
</li>
<li><p>check with the docker images to verify the build.</p>
</li>
</ul>
<pre><code class="lang-plaintext">docker build . -t my_django_todo:latest

docker images
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681065856387/d665d320-61ec-4c43-9e61-44c07b4ea0df.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p>Now time to create the docker container from the my_django_todo image.</p>
</li>
<li><p>You can use the customs port which you want to expose.</p>
<pre><code class="lang-plaintext">  docker run -td --name &lt;container_name&gt; -p port:port &lt;image_name&gt;
</code></pre>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681066283623/7c72d84a-2938-4a62-a26e-29586ec157b8.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p>The is built with the id 412000b1e4..</p>
</li>
<li><p>Check the Container status.</p>
</li>
</ul>
<pre><code class="lang-plaintext">docker ps
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681066440631/1d202bf9-e8a4-4cbd-b88c-8979d1faf55b.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p>As the Ubuntu machine is hosted on AWS, We need to add the inbound rule for the Ubuntu server to listen on port 8000.</p>
</li>
<li><p>Go to the <strong>EC2 (Selct your instance) &gt; Security Groups &gt; sg-0b95821a05b0e6d93 - launch-wizard-8 (This security group may vary in your case) &gt; Edit inbound rules &gt; ADD RULE</strong></p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681066839533/03915b28-7cee-49dd-a02f-0d59604150c1.png" alt class="image--center mx-auto" /></p>
<ul>
<li>Now its time to check the web-hosted app, Copy the public Ip of the Ubuntu server and connect to the container at port 8000</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681067147849/d1c3d10d-25ab-420b-b0ca-6ffd0c3d01cc.png" alt class="image--center mx-auto" /></p>
<p>Connect with me on LinkedIn/Github if you have any queries or doubts.</p>
<p>Linkedin - <a target="_blank" href="https://www.linkedin.com/in/harish-gaikwad855/">harish-gaikwad855</a></p>
<p>Github - <a target="_blank" href="https://github.com/harishgaikwad855">harishgaikwad855</a></p>
]]></content:encoded></item></channel></rss>