This project demonstrates a multi-site web environment using Docker Compose and Nginx, with SSL support, monitoring, and modern DevOps best practices. It is designed for local development and learning.
nginx-config/ # Nginx configuration files
nginx.conf # Basic config (HTTP)
nginx-ssl.conf # SSL-enabled config
nginx-secure.conf # Production-ready config
site1/ # Portfolio website files
index.html
site2/ # DevOps learning blog files
index.html
site3/ # API documentation site files
index.html
ssl-certs/ # SSL certificate files (self-signed or mkcert)
docker-compose.yml # Main Compose file (HTTP)
docker-compose-ssl.yml# Compose file for SSL
README.md # Project documentation
- Three independent static sites (Portfolio, DevOps Blog, API Docs)
- Nginx reverse proxy for multi-site routing
- SSL support with self-signed or mkcert certificates
- Live reload support (with Docker Compose v2.20+)
- Healthchecks, logging, and resource limits for Nginx
- (Optional) cAdvisor for container monitoring (Linux only)
- Docker and Docker Compose installed
- (Recommended) mkcert for trusted local SSL
- Add these to your
/etc/hosts:127.0.0.1 site1.local 127.0.0.1 site2.local 127.0.0.1 site3.local
docker-compose upVisit:
docker-compose -f docker-compose-ssl.yml upVisit:
If using mkcert, copy the generated .pem and -key.pem files to ssl-certs/server.crt and ssl-certs/server.key.
If you uncomment cAdvisor in docker-compose.yml (Linux only):
- Visit http://localhost:8081 for live container monitoring.
With Docker Compose v2.20+ and the develop/watch section, changes to site files or Nginx config will trigger a reload.
- Healthcheck: Ensures Nginx is serving traffic
- Logging: Rotates logs to prevent disk bloat
- Resource limits: Prevents Nginx from using excessive resources
- Restart policy: Restarts Nginx if it fails
- Edit
site1/index.html,site2/index.html, orsite3/index.htmlto change site content - Update Nginx configs in
nginx-config/for advanced routing or security - Replace SSL certs in
ssl-certs/for production
- If sites don’t load, check Docker logs and ensure
/etc/hostsis set up - For SSL warnings, use mkcert and trust the local CA
- cAdvisor may not work on macOS/Windows (use Docker Desktop dashboard instead)
MIT