Day 17  Docker Project for DevOps Engineers [Django app using docker]

Day 17 Docker Project for DevOps Engineers [Django app using docker]

#devops

Dockerfile

Docker is a tool that makes it easy to run applications in containers. Containers are like small packages that hold everything an application needs to run. To create these containers, developers use something called a Dockerfile.

A Dockerfile is like a set of instructions for making a container. It tells Docker what base image to use, what commands to run, and what files to include. For example, if you were making a container for a website, the Dockerfile might tell Docker to use an official web server image, copy the files for your website into the container, and start the web server when the container starts

first, clone the application in your aws server

Write dockerfile as below:

Provide permission to docker user using the below command

  • sudo usermod -aG docker $USER

Build the docker image:

Run the docker image and create the container:

Open the security group in AWS with edit inbound rules:

  • Verify that the application is working as expected by accessing it in a web browser

  • Push the image to a public or private repository (e.g. Docker Hub )

    login to docker hub create account >> on server use command docker login

      docker login
      docker ps
      docker tag django-todo-cicd_django_todo_app madhurip16/django-todo-app:latest
    
      docker images
      docker image push <image-name>
    

Thank you for reading this Blog. Hope you learned something new today! If you found this blog helpful, please like, share, and follow me for more blog posts like this in the future😊😊