6.3 Docker Project Lab - A Simple Web Application Deployment using Docker

Introduction

This hands-on lab is designed to provide you with a practical understanding of Docker by guiding you through the deployment of a simple web application. You'll gain firsthand experience in containerizing an application, illustrating Docker's core functionalities of building, running, and managing containers.

Objectives

Lab Steps

Step 1: Creating Your Web Application

mkdir simple-web-app 
cd simple-web-app`

Step 2: Writing the Dockerfile

nano Dockerfile

Step 3: Building Your Docker Image

Step 4: Running Your Docker Container

Step 5: Accessing Your Web Application

curl http://localhost:8080
<!DOCTYPE html>
<html>
<head>
  <title>My Simple Web App</title>
</head>
<body>
  <h1>Hello, Docker!</h1>
  <p>Welcome to my simple web application deployed using Docker.</p>
</body>
</html>

Summary

In completing this lab, you've successfully containerized and deployed a simple web application using Docker. Starting from writing a Dockerfile to building and running a Docker container, you've experienced the fundamental processes of working with Docker. This lab serves as a practical introduction to Docker, highlighting its potential to streamline application deployment. With these skills, you're well on your way to exploring more advanced Docker functionalities and architectures.