Skip to content

JEGSON/multi-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Site DevOps Project

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.

Project Structure

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

Features

  • 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)

Getting Started

1. Prerequisites

  • 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
    

2. Running the Sites

HTTP (no SSL):

docker-compose up

Visit:

HTTPS (SSL):

docker-compose -f docker-compose-ssl.yml up

Visit:

If using mkcert, copy the generated .pem and -key.pem files to ssl-certs/server.crt and ssl-certs/server.key.

3. Monitoring (Optional)

If you uncomment cAdvisor in docker-compose.yml (Linux only):

4. Live Reload (Optional)

With Docker Compose v2.20+ and the develop/watch section, changes to site files or Nginx config will trigger a reload.

Advanced Docker Configurations

  • 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

Customization

  • Edit site1/index.html, site2/index.html, or site3/index.html to change site content
  • Update Nginx configs in nginx-config/ for advanced routing or security
  • Replace SSL certs in ssl-certs/ for production

Troubleshooting

  • If sites don’t load, check Docker logs and ensure /etc/hosts is set up
  • For SSL warnings, use mkcert and trust the local CA
  • cAdvisor may not work on macOS/Windows (use Docker Desktop dashboard instead)

License

MIT

multi-website

About

multi-site web environment using Docker Compose and Nginx, with SSL support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages