Docker Project -1 for DevOps Engineers

Docker Project -1 for DevOps Engineers

RUNNING DJANGO APPLICATION USING DOCKER

Project Details

Objective

Containerizing Django App with Docker

Steps to Complete the Project

  1. Launch an EC2 instance and install Docker into it.

  2. Clone your repository.

  3. Create a Dockerfile.

  4. Run the Dockerfile to create an image, and then create a container from the image.

  5. Create the container and map it to port 8000:8000.

  6. Enable port 8000 in your instance.

  7. Put the instance IP address into the browser to check whether we can see our application.

Step-1 Launch an EC2 instance and install Docker into it

Step-2 Clone your repository

Step-3 Create a Dockerfile.

FROM python:3.9
COPY . .
RUN pip install -r requirements.txt
CMD ["python","manage.py","runserver","0.0.0.0:8000"]

Step-4 Run the Dockerfile to create an image, and then create a container from the image.

adding the user to the docker group so that we don't have to use sudo everytime

Step-5 Create the container and map it to port 8000:8000

Step-6 Enable port 8000 in your instance.

Step-7 Put the instance IP address into the browser to check whether we can see our application.

Here our task is finished

THAT'S ALL FOR TODAY'S LEARNING

I HOPE YOU LEARN SOMETHING FROM THIS BLOG