DevOps Case Study Final
DevOps Case Study Final
Case Study
Batch -
Title: To learn Dockerfile instructions, build a image for a sample web application
using Dockerfile.
Evaluation
Subject Incharge
Aim- To learn Dockerfile instructions, build a image for a sample web
application using Dockerfile.
Theory:
1. Introduction to Docker
Docker is a powerful open-source platform that enables developers to build,
ship, and run applications in isolated environments known as containers.
Containerization has revolutionized software deployment by making
applications more portable, scalable, and efficient.
• VMs have significant memory and CPU overhead, whereas containers use
fewer resources.
• RUN: Executes commands inside the container during the image build
process.
• CMD: Specifies the default command to run when the container starts.
app = Flask(__name__)
@app.route('/') def
home():
return "Welcome to Dockerized Flask App!"
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5000)
flask
5.2 Step 2: Writing an Optimized Dockerfile
Below is an optimized Dockerfile that follows best practices, such as
minimizing image size and security enhancements.
FROM python:3.9-slim
WORKDIR /app
COPY . .
EXPOSE 5000
7. Conclusion
This lab manual provided an in-depth exploration of Docker, covering
fundamental concepts, advanced techniques, and practical exercises. By
containerizing a Flask web application, students gained hands-on experience
in writing Dockerfiles, building images, and running containers.
Understanding Docker is essential in modern software development, enabling
seamless deployment, scalability, and resource efficiency. Further exploration
of container orchestration, cloud deployment, and security best practices will
enhance proficiency in DevOps and cloud-native technologies.