Project Case Study

Containerized Website: Docker & Nginx

I built a custom Nginx image on a Beelink mini PC and served an HTML page locally through Docker.

Core stack

  • Beelink mini PC
  • Windows 11 host operating system
  • Docker Desktop with WSL2 backend
  • Nginx base image
  • Custom Dockerfile
  • Custom index.html served through the container
  • Browser based localhost testing

What I built

  • Created a dedicated project folder for the containerized site.
  • Built a simple custom HTML page to be served through Nginx.
  • Created a Dockerfile to define how the image should be built.
  • Built a custom image instead of relying only on the default Nginx image as is.
  • Mapped host port 8080 to container port 80.
  • Stopped, removed, and recreated the container to apply changes properly.
  • Verified the page was loading successfully in the browser from the rebuilt container.

Issues I had to solve

I worked through missing files, incorrect paths, and container lifecycle errors.

  • Learned that docker run requires an image name at the end of the command.
  • Learned that docker stop requires an existing container name or ID.
  • Hit a build failure because the project folder did not yet contain a Dockerfile.
  • Corrected the Dockerfile after initially using the wrong nginx file path.
  • Learned that a successful image build does not automatically update an already running container.
  • Reinforced the difference between an image and a container through rebuilding and rerunning the project.

Commands I used

  • docker build -t beelink-nginx-site .
  • docker stop beelink-nginx
  • docker rm beelink-nginx
  • docker run -d -p 8080:80 --name beelink-nginx beelink-nginx-site
  • docker ps

Evidence

Proof snapshots

The host, Docker environment, running container, and browser result.

Beelink mini PC used as the container host
Dedicated Beelink mini PC used as the host machine for the project.
Docker Desktop running on Windows 11 with the environment active
Docker Desktop active on the host system with the container environment running.
Terminal output showing the rebuilt container and mapped port
Terminal proof showing the running container and mapped host to container port.
Browser displaying the custom page served through the container
Browser based proof that the custom page was being served from the rebuilt Nginx container.

Next Stage

Where this project should go next

Docker Compose setup

Use Docker Compose to make builds and deployments easier to repeat.

Custom CSS in container

Add CSS and more pages to the containerized site.

Multi container growth

Explore a reverse proxy, persistent storage, and additional services.