Hi there! Welcome to my new website and blog! It’s been a long time since I I’ve had a fully functioning blog, and since I’ve redesigned my website!
The following is a summary of how I built sites, how I could have built this site, and what I ended up doing in the end!
tldr? it's just static wordpress
Building the Old Websites
Not to say it’s my first attempt! I’ve been making half finished betas for years.
My old single page sites were functional, but limited in the kinds of content I could share. These sites were just static pages hosted with NGINX on a Linux Virtual Machine (VM).
In 2024, I’ve realized that I need a portfolio, one where I can share more of the things I create! I’ve been reluctant to try WordPress since my last duels with it in 2014 for my employer’s site, but a lot has changed since then.
Since then, I have given a few other frameworks a try, but no free offering came close to the level of support and community that WordPress provides.
So it was back to WordPress again. But how would I deploy it?
How Not to Deploy
Recently, I’ve been using a more modern containerized workflow for my software applications. Over the past year and a half, I’ve been moving more and more of my web-services into containers, helping keep their runtime environments isolated for maintainability and security. It’s been going well, but this time I decided to go one step further.
Also recently, I’ve been moving more of my infrastructure to be defined as Infrastructure-as-Code. I’ve been mainly using RedHat Ansible to do this. It’s really neat, and the Docker deployments are too, but it’s not what this blog post is about!
I wanted to go one step further than that, though. I wanted run my new WordPress blog in a container, on Kubernetes, deployed with Ansible.
I’ll save you the technical details, but after two days of digging into the project, I made significant progress, but was still having problems getting the new-to-me load balancer to properly provision me site certificates.
I will be revisiting this in the future, but with a clean install first before my migration. 😉
But why didn’t you use a commercial offering?
I’ve been renting a virtual private server from Afterburst since 2012. Despite many software companies using offerings from major cloud providers like Microsoft, Amazon, and Google, rented VMs from smaller companies can be quite competitive. I recently compared Azure to my current setup, I’d be paying at least twice as much for the same service. Smaller companies will offer unlimited data transfer to these VMs as well, some that many of the larger companies don’t offer.
When I made the decision to rent from Afterburst, I was a broke university student, who was focused on saving money. Afterburst’s VMs were cheaper. And if anything I made went viral, I wouldn’t be paying thousands in server networking costs, I might just get a frustrated email from Afterburst’s IT team.
In more recent years, I prefer to use the containerized environments that I’d typically use at work. To do easily on my server, I just use Docker, and I install the daemon with Ansible. It’s luckily fairly well documented, and easier to do than you’d think! This method isn’t that scalable without using Docker Swarm, but for small services, a single instance is fine.
So how did you actually build it?
It’s really simple! It’s just a static site, generated from WordPress. Initially I had a setup of WordPress running in Docker, but I switched to Local, a really great tool for managing WordPress instances. After a bit of configuration, and the setup and install of Simply Static and Björk, I was off to the races.
So how is WordPress these days?
Fantastic, to be honest. There still are a few plugin headaches with newer versions, but some things never change. The biggest difference since the last time I used WordPress is the new design tools for laying out pages! It makes it so easy to try new layouts, and to perfect your pages. It really reminds me of tools that may be considered more modern, like SquareSpace. The big difference here is my hosting is a quarter the price!
The Secret Sauce: Static
I had an epiphany when I was working with the Ansible and Kubernetes setup. I realized that all of my pages would have few interactive components that would require a server, and that creating all these resources was overkill when the files could just be hosted, without a server rendering a fresh webpage every time. The page is rendered on my local machine and saved, which I then upload to my host.
Things didn’t work perfectly with this approach. A more recent version of WordPress broke the Static Site generator. A few JavaScript libraries couldn’t be picked up by the static site plugin. I wrote a simple script to find-and-replace these bad references, and that’s it! The website was ready for content.
This approach ends up with a full site that’s under a megabyte! Wow!
To make deployment from my personal machine, I have a small script that uses rsync
to copy the static files.
So what now?
Blog more, I guess! In terms of developing the blog deployment? I’ll be moving the deployment pipeline into GitHub Actions to encourage myself to push my work more often, and to have my site more easily editable across multiple devices.
Thanks for visiting my blog! I hope to post more soon 🙂