#90DaysOfDevops | Day 17

Rajendra PatilRajendra Patil
2 min read

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

What is Docker File ?

A Dockerfile is like a set of instructions used for making a container .

It tells Docker what base image to use, what commands to run, and what files to include .

Dockerizing a Simple Python flask App

  1. Clonning Git repository : Clone the git repo that contains all the code , dependencies, required for running Python App .

    Repo URL : https://github.com/ankitgithub25/flask-app-ecs.git

  1. Creating Docker File :

  1. Creating Docker Image :

    Docker Image : Docker images are read-only templates that contain instructions for creating a container

docker build -t python-learning-app .

  1. Running Docker Run command :

    Docker run : It is used for developing, shipping, and running applications in containers.

    docker run -d -p 80:80 python-learning-app:latest

As our Application is working on Port 80 , so we are publishing and binding port 80 of our host and container .

Adding Port 80 to our EC2 Security Group to expose App :

Testing our Application :

This is how you can test and explore endless opportunities with help of Docker .

Thanks for visiting . Keep Learning !!

0
Subscribe to my newsletter

Read articles from Rajendra Patil directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rajendra Patil
Rajendra Patil