Table of contents
- RUNNING DJANGO APPLICATION USING DOCKER
- Project Details
- Objective
- Steps to Complete the Project
- Step-1 Launch an EC2 instance and install Docker into it
- Step-2 Clone your repository
- Step-3 Create a Dockerfile.
- Step-4 Run the Dockerfile to create an image, and then create a container from the image.
- 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.
- THAT'S ALL FOR TODAY'S LEARNING
RUNNING DJANGO APPLICATION USING DOCKER
Project Details
Objective
Containerizing Django App with Docker
Steps to Complete the Project
Launch an EC2 instance and install Docker into it.
Clone your repository.
Create a Dockerfile.
Run the Dockerfile to create an image, and then create a container from the image.
Create the container and map it to port 8000:8000.
Enable port 8000 in your instance.
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