WirelessMoves In A Container

I’m interrupting the regular programming today for a minute for a special infrastructure announcement! You might have guessed that I had a couple of things in mind when I started my Dockerize-Me learning journey some time ago and one of them was to put this blog, now in its 16th year, into a container.

A Bit Of History

In total, this is the 3rd significant infrastructure change. Back in 2005, I started the blog on Typepad, a popular but proprietary blog hosting platform of its day. At some point, my requirements outgrew Typepad, which was on the decline anyway, so I decided to migrate to WordPress and host it myself. It was a painful move as Typepad, probably on purpose, did not support migration well. But with some effort, I wriggled my data free. As I didn’t want to install and configure the web server and PHP myself, I chose to run the blog at Uberspace, a managed server hoster and ran the blog from there for some years.

Over the years, I gained experience with setting up web servers, so I eventually moved the blog to a virtual machine running in one of Hetzner’s data centers in Germany. This time around, migration was straight forward, as WordPress makes this very simple. So this has been the state of the art for several years now. However, even though I selected the smallest VM instance possible, the load on the server is very low. Yes, I am very much niche, I know!

Containers, Containers, Containers…

So at some point, the idea was born to move the blog into a container and put it behind a reverse proxy so I could run more than one service on the same virtual machine. It took me a while to get there, as Worpdress was not really developed to live in a container. This makes the setup a bit strange, at least to my eyes, and I first wanted to understand the setup and the implications thoroughly. For those of you who are interested, I will go into the details in a follow-up article.

So as of yesterday, 6. February 2021 8.30 pm CET, the blog is running in a container on a virtual machine in a Hetzner data center. The outage time during the cut-over was less than 2 minutes. Yes, I rehearsed the move beforehand to make it quick. A seamless transition would have been possible but that would have required moving the TLS certificate to the new instance manually and fiddle with some JSON configuration files of the reverse proxy. I’m a perfectionist, but not at any cost. So I chose to just change the DNS domain entry to the new IP address, wait for it to propagate with a time to live of 1 minute, and then fire up the container. This triggered the reverse proxy to get a new certificate from Letsencrypt within a few seconds.

And just for the fun of it, I didn’t choose Germany as location, but Helsinki, Finland. That probably adds a few milliseconds to the round trip time but I haven’t noticed any difference, really. And true to my original intentions, that VM also runs three other services, each with its own domain name: An Etherpad instance and two instances of my research database service I’ve been working on in my private time over the years.