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.
nginx-docker-lab/ βββ docker-compose.yml # Defines the NGINX service with bind mount
βββ site/
βββ index.html # Custom HTML page served by NGINX
- 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
docker run -d \
--name nginx-volume \
-p 8082:80 \
-v $(pwd)/site:/usr/share/nginx/html \
nginxThen open: http://your-vm-ip:8082
Option 2: Run with Docker Compose
docker compose up -dThen 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
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