This project leverages NGINX docker image, H5BP configs and Certbot image to provide a plug and play HTTPS static gzipped file server with subdomain capabilities.
You will need a machine with internet connection, Docker, Docker Compose and docker storage base directory properly setted.
Lets say that our root domain is example.com
and en.example.com
is a subdomain, this configuration redirects:
example.com
towww.example.com
.www.en.example.com
toen.example.com
.
This configuration redirects HTTP requests to their HTTPS counterpart.
- Folder index is
index.html
. - Missing page should be
/thispagedoesntexist.html
, otherwise default NGINX 404 page is returned. - An URL without a page extension is valid, for ex.
www.example.com/index
The the domain root is /var/www
(in-container folder), the data should follow the structure /var/www/subdomainname/html/subdomaindata
, for ex.:
/var/www/
├── en/html/
│ ├── index.html.gz
│ ├── thispagedoesntexist.html.gz
│ ├── loremipsum.html.gz
│ ├── awesome/
│ │ ├── index.html.gz
│ │ │── aprimatesmemoir.html.gz
│ │ └── .../
│ └── .../
├── www/html/
│ ├── index.html.gz
│ ├── thispagedoesntexist.html.gz
│ └── .../
└── .../
curl https://raw.githubusercontent.com/ebonetti/tatic/master/docker-compose.yml | DOMAIN=example.com EMAIL=email@example.com PATH2DATA=/path/2/your/dir docker-compose -f - config | tee docker-compose.yml
Download and set up your configuration file, setting up the domain asexample.com
, the mail (used for HTTPS certificate request) asemail@example.com
and setting the website folder to/path/2/your/dir
.docker-compose up
Start NGINX server and certbot certificate requests.docker-compose up -d
Start detatched.docker-compose pull
Update images to the last revision.docker-compose down
Stop and remove container and networks.docker-compose logs -f
Fetch and follow the logs.docker-compose ps
Check containers status.docker system prune -fa --volumes
Remove system wide all unused images, containers and volumes (with old certificates) without asking for confirmation.