Date: 07/02/2026
Author: Divyanshu Gaur
SAP ID: 500121752
The objective of this lab is to:
A Flask project directory was created with application file, requirements file, and Dockerfile.
Execution Screenshot:

The Flask application was written with a root route serving an HTML page containing lab details.
Execution Screenshot:

The dependency file was created specifying Flask version.
Execution Screenshot:

A Dockerfile was created using Python 3.9 slim image with working directory, copy steps, dependency installation, port exposure, and run command.
Execution Screenshot:

The Flask app was executed directly on the host system.
Command:
python app.py
Execution Screenshot:

The application output was verified in the browser and using curl.
Execution Screenshot:

Python slim image was pulled from Docker Hub.
Command:
docker pull python:3.9-slim
Execution Screenshot:

A container was started and Flask was installed inside it. The application was created and executed inside the container.
Command:
docker run -it --name flask-container python:3.9-slim /bin/bash
Execution Screenshot:

Running containers were checked using docker ps.
Command:
docker ps
Execution Screenshot:

The Flask app running inside the container was accessed through localhost port mapping.
Execution Screenshot:

The running container was stopped and was removed from the system.
Command:
docker stop flask-container
docker rm flask-container
Execution Screenshot:

The Flask web application was successfully:
This experiment demonstrated Docker-based containerization of a Flask web application. It validated portability, environment consistency, and simplified deployment using containers.