Skip to content
Related Articles

Related Articles

Dockerizing a simple Django app

View Discussion
Improve Article
Save Article
  • Last Updated : 30 Sep, 2022
View Discussion
Improve Article
Save Article

Docker is a set of the platform as service products that use OS-level virtualization to deliver software in packages called containers(namespace). here, we are dockerizing a simple user login and sign up Django project. The project we are using too dockerized is Sign Up and log in

To download source code use

$ git clone

The next step is to add Docker to it. So, create an empty file named Dockerfile and put this code inside it

$ touch Dockerfile

now edit it.

FROM python:3.6

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . .

CMD ["python", "", "runserver", ""]

Now we need to build our Docker image and run it. This can be done by the following command :

to build image

$ sudo docker build -t image_name .

to see if image exit use and you can see all your images.

$ sudo docker images

to run docker application use

$ sudo docker run -p 8000:8000 image_name

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!