Amsterdam power outage and some downtime
So there was a massive poweroutage in Amsterdam yesterday which took down my VPS. This meant I had to manually restart the servers (docker containers) running my website. The nginx webserver did come back up automatically with the archlinux image running on the VPS. But since I did not properly configure the backend or document many of the steps I originally made it took me a bit of time to get everything up and running again.
I did learn that restarting your docker containers is actually very simple. Simply running
docker restart <container id>
did the trick. And in case you forgot the id's you can find those by simply running:
docker ps -a
I wrote a not so great Dockerfile
The only problem then was that I apparently provided a database cleanup script as the entry point to my postgresql docker container, dropping all the data for my blog. Thankfully I still have the markdown files in git for all the articles. Yes, I write these articles in the markdown language using Macdown. This makes it easy to write my articles while offline and just post the markdown file to my website.
Then again this website is running on a very unfinished piece of java code that I had not touched for a while I had to check the code to find the url's to the admin pages :-).
Why did I code my own blog again?
Part of setting up this website/blog using my own code is also to understand docker's usecases better and to figure out which parts I do and don't like about it.
Things to come
So what's left is to read the docker documentation and figure out how to automatically restart the containers in case this ever happens again. Another important thing to do first is to fix the restart procedure of my postgresql database container so it does not drop the data. This should not be too hard since I already mounted a host volume to hold the data for the database.
And ofcourse get the code that runs this website and blog to a more mature level. Which is not my top priority since I am working on another project that will get some fulltime attention from the first of March this year. More on that later.
Oh by the way my VPS provider Transip explained why my VPS went down in a long email with followup. Basically the generator failed to start because of a faulty part which was tested ok just three weeks prior. So yeah shit can happen and I would still recommend them.
Taking ages between writing blog articles
Apparently I don't write that often on this blog. As I am currently still freelancing, for nearly three years now, for the municipality of Rotterdam and my daily commute is about 175 miles I don't have too much time to do interestingly enough things to blog about. Enterprise software is not something I like to write about. Which is exactly the reason I'll be doing something different starting March 1st.