2 minutes
Using Docker for self-hosted websites
Over the years, I tried different ways of hosting websites and web applications. Back in the days, I rented traditional webspace to host a single site. This is still valid for some websites for which I take care of minor administrative tasks like updates and visual changes.
In order to improve my workflow, I aimed for a development/production separation of a Drupal website. This enables me to test core/module updates in a separate environment and push them to production as soon as I suppose that the updates won’t crash the site.
Because a downtime of a few minutes is not a problem, this workflow is sufficient for my purpose. That’s why I did not implement a fully-fledged CI/CD pipeline (yet?). I am using Git for this workflow and wanted to run a private GitLab instance for merge requests, tracking tasks etc..
My next step was installing GitLab on a rented root server using it’s omnibus package installation for Debian. This worked pretty well especially when it comes to updates. But with my wish for encrypted HTTPS connections (Let’s Encrypt) and additional other web software (Nextcloud, static website, …), a lot of configuration would have been necessary. In addition, the resulting effort to keep all systems up to date and running would have been too high. Coming with GitLab 10.5, HTTPS using Let’s Encrypt is included and can be activated with a single line of code.
That’s why I switched to Docker. It is still some configuration necessary, but all in all it is way easier for me to handle. Furthermore, switching to another server in the future should be a rather easy task. I just need to upload my nightly backup that includes configuration and Docker volume files and start the Docker containers.
The software I wanted too install were:
I started writing this blog, because I read a lot of documentation, different tutorials, StackOverflow questions, etc. to reach my goal and there were no comprehensive tutorials describing the individual installation of those tools including an encrypted HTTPS connection.
So that’s why I hope that I can help somebody with similar problems I had. For this, I have separate articles for the installation of: