Deploying Application Using Docker

Deploying Application Using Docker

#90DaysofDevops #TrainWithShubam #Day 17 task

ยท

1 min read

Note: Please add your public ip to localhost in settings.py file filepath /user_management/settings.py

Cloning Repo from GitHub

git clone https://github.com/jrapolug/Django-page.git

Change to project Directory

cd Django-page

Creating Dockerfile and Writing file

vim Dockerfile

FROM python:3

WORKDIR app

COPY . /app

RUN pip install -r requirements.txt

RUN python manage.py migrate

EXPOSE 8000

CMD ["python","manage.py","runserver","0.0.0.0:8000"]

Building Image using Dockerfile

docker build . -t django-login-page

Running Container Using Docker Image

docker run -d -p 8000:8000 --name django-page django-login-page:latest

Pushing Your Image to dockerhub

docker login
docker push image

Successfully Deployed Webpage by Creating Docker File, Built Docker Image and Created Container Using an Image. Now open localhost:8000 to open it in your Browser ๐ŸŽ‰๐ŸŽ‰.

ย