Self-hosted static website using Docker
Since I was already migrating all projects running on my server into Docker containers, of course my private homepage needed to be migrated as well. This homepage is just a very basic static HTML page. This makes it rather easy to create a Docker container for it. So what I’m in the end just doing, is using a plain nginx image and injecting my homepage source code into the appropriate folder (
I’m hosting my homepage source code on my private GitLab instance, which I clone into the same folder, where my
docker-compose.yml is located. By defining the path to this cloned repository as a Docker volume mounted to
/var/www/html, the configured nginx shows my homepage by default.
Apart from that, I added a
nginx.conf file, mostly specifying nginx’ root folder and the server name.