Introduction
What You Will Build Today
By the end of this tutorial, you will have:
A live web server running inside Docker
Your custom HTML page served from a container
A persistent website that survives container death
Screenshots proving every step works
Time required: 20 minutes
Prerequisites: Docker installed (I will show you how to check)
Why Project-Based Learning
When I started learning Docker, I watched hours of videos and forgot everything. Then I switched to building real projects. This is Project 1 of 6 in my "Docker Zero to Hero" series.
Let me show you what I built, step by step.
Section 1: Verifying Docker
Step 1: Is Docker Alive?
First, I opened my terminal (PowerShell on Windows with WSL2 enabled).
command: docker --version
docker ps
I got back a long container ID - that is proof it worked.
Refreshed my browser:
Refreshed my browser:
What -v "$(pwd):/usr/share/nginx/html" means:
Part Meaning
-v Volume mount flag
"$(pwd)" My current folder on my computer
: Separator
/usr/share/nginx/html Folder inside the container
Translation: "Docker, mirror my computer's folder inside the container. When I change files on my computer, change them in the container too."
Refreshed my browser:
What I learned:
Without volumes: Data dies with container
With volumes: Data lives on your computer, containers just read it
This is how databases, file uploads, and user data survive restarts in production
SOCIAL SHARE CARD GENERATOR