This experiment demonstrates how to containerize a Python Flask web application. The process includes writing a Dockerfile, building a container image, and mapping ports to access the application from a local browser.
The project directory Flask-container contains the following essential files:
Below is the screenshot of the Flask application code:

Screenshot of the requirements file:

Screenshot of the Dockerfile configuration:

Command Used:
docker build -t flask-container .
Screenshot of the Docker build process:

Command Used:
docker run -d -p 8080:5000 flask-container
Explanation: - 8080 → Host machine port\
Screenshot of the docker run command:

Command Used:
docker ps
Screenshot of the docker ps output:

Open in browser:
http://localhost:8080
Screenshot of the web application running in the browser:

The Flask web application was successfully containerized and deployed. The Docker image was built successfully, the container ran without errors, and the application became accessible through the mapped host port.
Docker simplifies the deployment process by bundling the application with its runtime environment. This ensures consistent execution across different systems and eliminates environment-related issues.