Day 17 : Docker Project for DevOps Engineers.

Radheya Zunjur
2 min readJul 5, 2023

--

In this article we will dive into an exciting project that focuses on Docker, a powerful containerization technology widely used in the world of DevOps. In this project, we will explore how Docker can revolutionize the deployment and management of applications in a highly efficient and scalable manner.

What is 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.

Tasks

  1. Create a Dockerfile for a simple web application (e.g. a Node.js or Python app)
FROM python:3
WORKDIR /data
RUN pip install django==3.2
COPY . .
RUN python manage.py migrate
EXPOSE 8000
CMD ["python","manage.py","runserver","0.0.0.0:8000"]

2) Build the image using the Dockerfile and run the container.

docker build -t radheyzunjur/to-do-app
docker run -p 8003:8003 59fedb60c6880e9f2f58e98eeb1a048149052d1a2d36be7354392e28f6609d12 radheyzunjur/to-do-app:latest

3) Verify that the application is working as expected by accessing it in a web browser.

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

docker push radheyzunjur/to-do-app:latest

By the end of this article, you have learnt how to build, run and push the docker image to Dockerhub. We will dive little deeper into docker in the next article. Stay tunned!!!

--

--

Radheya Zunjur
Radheya Zunjur

Written by Radheya Zunjur

Database Engineer At Harbinger | DevOps | Cloud Ops | Technical Writer

No responses yet