The evolution of the site
I first got the idea to host a website after roughly my third Raspberry Pi 5. If you do a web search for the most common uses for a Raspberry Pi or similar SBC, web hosting is on basically every list. That’s because it’s relatively easy these days. I wanted a ‘traditional’ web-hosting experience so I deployed a classic LAMP (Linux, Apache, MySQL, PHP) stack. I didn’t want to write raw html for the site (unless you count the pimp things coming soon bish...
message I started with) so I added Wordpress, picked a minimal theme, and put up a glorified Hello World page.
I was leery about opening my home network to the internet via port forwarding so after researching a couple alternate ways to accomplish this I decided a Cloudflare tunnel would be the easiest way to set up secure access to my server. So I bought a domain that spoke to me, pointed it to my Cloudflare DNS servers, deployed the tunnel and boom! - thepimpest.com was live for the whole world to see.
- How do you update the main page? idk
- How do you add a picture with text overlay? idk
- How do you change the default categories on the page theme? fuck man idk, you ask a lot of questions
I’m not a web developer. As an infrastructure admin by day, I had a lot of fun learning how to set up the infrastructure (basically everything up to this point) but making that additional leap was not easy. Wordpress was not intuitive to me, so like all things that aren’t immediately easy for me I deserted it lol.
After a few months I realized what was stopping me from coming back to it was the complexity of Wordpress. I needed a better way. An easier way. So I researched other ways to create sites that aren’t so… Wordpressy. I found and tried several but I was a big fan of Jekyll, which is a static website generator that uses markdown as the primary content format. This is perfect for me because I already know how to write markdown and it doesn’t seem to have a huge amount of technical knowledge required to get started. It takes your content and delivers it as html in the style of the theme you are using. It’s seriously magic. Wordpress sucks.
I proved it out, it met my needs, but how do I deploy it without LAMP? Since I deploy other services in my homelab via Docker containers I thought maybe I could spin up a simple Apache container and throw my bundled Jekyll site in it. I could, I was geeked! It worked really well, overall it was the easiest web-hosting solution I’ve found so far. After replacing the Wordpress site with a site generated by Jekyll and delivered via Docker, it came time to make my first update.
Without much forethought I thought it would be a good idea to only keep the bundled Jekyll site (just the contents of _site
) in my Github repo. Maybe for security? I don’t know but when you do this, you are excluding all the base building blocks Jekyll uses to magically generate the site in the first place. So when I went to make my first update and I was on a different machine, I realized that I was missing everything I needed to pick up where I left off :facepalm: I was doing some hardware shuffling and the machine I was originally testing from was wiped out. Soooo I cloned the Jekyll theme again, and rebuilt the site to that initial state again, then uploaded it to Github again, and this time I included the whole cloned theme repo. NOW I can easily pick up from anywhere and start coding. Don’t do what I did.
My updated process was this:
- Use Jekyll to bundle the site data
- Sync to Github
- Download on the web server
- Copy the contents of the
_site
directory to my container directory - Restart the local Apache container
It was clunky and it worked but I cannot leave well enough alone. How can I make it more efficient? Can I skip any steps in the process? My container is not doing much, can I possibly include the site content in the container before I download and run it? Fuck yes I can.
You can absolutely build a container that’s based off an Apache container (the same one I was already using), which contains the same site data I was manually copying over. And you can absolutely register the container with Github container registry. AND you can absolutely pull the container image and run it from your web server and it just comes up, content and all.
Now the process is this:
- Use Jekyll to bundle the site data
- Use Docker to create a container that contains the site data
- Register the new container with Github
- Pull the custom container on the web server
- Start the container with a
--restart=always
option
Same amount of steps, but less clunky.
So that’s it, the story of how thepimpest.com was conceived and brought to life… but in a not creepy, reproductive-sounding way.