Docker Project for DevOps Engineers

Rajat Chauhan is a skilled Devops Engineer, having experience in automating, configuring, deploying releasing and monitoring the applications on cloud environment.
• Good experience in areas of DevOps, CI/CD Pipeline, Build and Release management, Hashicorp Terraform, Containerization, AWS, and Linux/Unix Administration. • As a DevOps Engineer, my objective is to strengthen the company’s applications and system features, configure servers and maintain networks to reinforce the company’s technical performance. • Ensure that environment is performing at its optimum level, manage system backups and provide infrastructure support. • Experience working on various DevOps technologies/ tools like GIT, GitHub Actions, Gitlab, Terraform, Ansible, Docker, Kubernetes, Helm, Jenkins, Prometheus and Grafana, and AWS EKS, DevOps, Jenkins. • Positive attitude, strong work ethic, and ability to work in a highly collaborative team environment. • Self-starter, Fast learner, and a Team player with strong interpersonal skills • Developed shell scripts (Bash) for automating day-to-day maintenance tasks on top of that have good python scripting skills. • Proficient in communication and project management with good experience in resolving issues.
Create a Dockerfile for a simple web application (e.g. a Node.js or Python app)
Build the image using the Dockerfile and run the container
Verify that the application is working as expected by accessing it in a web browser
Push the image to a public or private repository (e.g. Docker Hub)
Steps to set up the Project:
- Install Git

- Install Docker engine

- Make a directory for your project

- Clone GitHub repository




Docker File of our application

Breakdown of Dockerfile:
- This line sets the base image to Python 3.11

- Sets the working directory inside the container to /app.

- It will copy all the source code from the local to the container

- It will update pip and install the required dependencies.

- The command used to run the app.

Build Docket image from Dockerfile
Building a Docker image is a crucial step in containerizing your Flask application.
It involves packaging your application and its dependencies into a single, portable image.
To build the Docker image, open a terminal and navigate to the directory containing your Dockerfile and application code.
Execute the following command:
1.


2.



Run the Docker image as a container
Once you have successfully built your Docker image, the next step is to run it as a container.
This involves creating an instance of your image, a runnable environment for your Flask application.
Execute the following command in the terminal:


Run the Flask Application on the browser
Goto <public_ip>:host_port

API Response

Stop Container:


Delete Container:


Push the Docker image to Docker Hub
- Log in to Docker Hub and create a repository

- Use the below command to log in on the Ubuntu machine, from where you have to push the image on Docker Hub and provide your username and password.


- Run below command to push the image









