Skip to content

> Docker-based lab deploying a custom NGINX container with persistent volumes and orchestration via Docker Compose. Includes custom HTML, volume mapping, and NSG configuration on Azure. > > Built and deployed on an Ubuntu 22.04 VM in Azure as part of a DevOps/SRE learning project.

License

Notifications You must be signed in to change notification settings

gil-daniel/nginx-docker-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

nginx-docker-lab πŸš€

License: MIT

A hands-on Docker project that sets up a custom NGINX container with persistent volumes and orchestration using Docker Compose. Built and deployed on an Ubuntu VM hosted in Azure, as part of a personal DevOps/SRE learning journey.


πŸ“ Project Structure

nginx-docker-lab/ β”œβ”€β”€ docker-compose.yml # Defines the NGINX service with bind mount
                  β”œβ”€β”€ site/ 
                    └── index.html # Custom HTML page served by NGINX

🧠 What You'll Learn

  • How to create and build a custom Docker image with NGINX
  • How to bind a local directory as a volume to persist website content
  • How to use Docker Compose for local container orchestration
  • How to expose and access services through specific ports
  • How to configure NSG (Network Security Group) rules in Azure

βš™οΈ How to Run

Option 1: Run with Docker CLI and volume

docker run -d \
  --name nginx-volume \
  -p 8082:80 \
  -v $(pwd)/site:/usr/share/nginx/html \
  nginx

Then open: http://your-vm-ip:8082


Option 2: Run with Docker Compose

docker compose up -d

Then open: http://your-vm-ip:8083

πŸ” Make sure the corresponding ports (8082, 8083) are allowed in your Azure NSG rules.


🌍 Environment

  • Ubuntu 22.04 LTS (Azure VM)
  • Docker CE + Docker Compose
  • NGINX (official image)
  • Git + GitHub

🏁 Next Steps (Ideas)

  • Add backend container (e.g. Node.js or Python) to compose file
  • Add named volumes and test persistence across rebuilds
  • Host this static site via HTTPS using NGINX + Let's Encrypt
  • Publish image to Docker Hub
  • Set up CI/CD pipeline using GitHub Actions
  • Deploy the stack to AKS or Azure Container Apps

βœ… Project Status

This project has reached its initial goal as a self-contained NGINX container lab and has been marked as complete for version 1.0.0. While future enhancements (such as CI/CD, HTTPS, and backend orchestration) are noted, no further updates are currently planned. Feel free to fork and expand it. Thanks for following along!


🀝 Author Daniel Gil
πŸ’» DevOps/SRE in Progress
πŸ“ Hosted on GitHub

About

> Docker-based lab deploying a custom NGINX container with persistent volumes and orchestration via Docker Compose. Includes custom HTML, volume mapping, and NSG configuration on Azure. > > Built and deployed on an Ubuntu 22.04 VM in Azure as part of a DevOps/SRE learning project.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages