Running Arch Cloud Labs On $1
2024-10-18 08:0:0 Author: www.archcloudlabs.com(查看原文) 阅读量:0 收藏

About The Project

The best blogging platforms are frictionless, and give the author control on how to create and share content. Arch Cloud Labs hosting has evolved over the years from a simple Digital Ocean droplet to a containerized deployment with CI/CD integration with a Cloud provider. This article briefly covers that journey and highlights the ease of integration and low cost of operating a modern blog with Digital Ocean’s App Platform. This is not a sponsored post or anything other than my experience running a blog. What used to cost me roughly $5 most months, is now optimized to less than $1 a month. The diagram below demonstrates the CI/CD workflow for Arch Cloud Labs blog deployments.

./ACL_Deploy_Pipeline.png

The Journey From Rsync to Git Push

The underlying platform powering Arch Cloud Labs is Hugo. Hugo converts simple markdown files into a nice HTML template making it easy to focus on the content. I’m a huge fan of Hugo. By using markdown files as the source of all blog posts, from day one I could write my blog in Vim, have revision control on Github and push changes as needed. Through using git and markdown, I treat each post as a “feature branch”, and once I’ve said article I’ll merge said branch into main and push.

In the early days of Arch Cloud Labs, Hugo was paired with certbot, Let’s Encrypt and a Nginx web server on a single $5 Digital Ocean instance. Certbot handled auto updating Let’s Encrypt TLS certificates for this website, and I would rsync local markdown files from my laptop to the web server, execute hugo build, and then voilà! Arch Cloud Labs’ latest content was live! The manual configuration and maintenance of a single droplet was easy, but in the world of automation, cloud and containers the overwhelming number off alternative options became too attractive to ignore.

Additional growing pains came with trying to figure out how to trigger automated deployments on the most recent git push so I could just leverage Github as the source of truth. Integrating a web hook to trigger a change seemed extreme and unnecessary, as did having an Ansible roles to perform the tasks in succession. This is around the time I became aware of Digital Ocean’s App Platform. Digital Ocean’s App Platform lets you easily deploy static websites as well as other container based applications via integrations such as Docker Hub, Gitlab, Github, etc… Through API access, Digital Ocean can pull from a private Github repository where Arch Cloud Labs markdown files live and build the static content within a Hugo container. The console page of the app platform give you a snapshot of health, logs and console access (if necessary) to your container.

./platform.png

Notably, the bottom left pane shows “$0.00”. This is not a mistake, at the time of this blog post I haven’t been charged anything the past three months as my bill has been below $1. Digital Ocean does not charge you unless you breach the 1.00 USD limit. Since Arch Cloud Labs is not a high-volume bandwidth site by any means, I stay well below the resource limitations that otherwise would impact the monthly bill.

The only “got cha” I have experienced with this deployment over the past few years is versioning with Hugo. Hugo is an evolving blogging platform that deprecates features like any other software project. However, I’m quite happy with the template and associated features you see today on Arch Cloud Labs. To ensure features are not broken, I’ve added additional environment variables to the Docker container that is built via Digital Ocean’s platform to version pin the Hugo version. This resolved broken images, CSS styling, and other UI issues I was having when using the latest version of Hugo.

Something that may be a “got cha” for you, is the lack of log access. To obtain logs from said containers, log forwarding to one of a few provided services has to be configured. I treat Arch Cloud Labs as more of a “portfolio of projects” than an active application, so access to container logs isn’t something I particular care about. Google analytics can provide browsing stats, and searching social media can show who’s sharing Arch Cloud Labs posts. However, this is something not to be overlooked for a more typical container deployment.

Beyond The Blog

I’ve been asked “what’s the best blog hosting platform” and I really don’t know. Hugo + a CI/CD integration works for me and I like the workflow. For some, a Medium or Wordpress hosted blog may seem more appealing depending on the content they’re writing and the audience they’re hoping to reach. The ability to integrate blog post deployment like a Software Project is neat and a talking point for job interviews. Using Digital Ocean’s platform for static content hosting has had almost not financial impact on me and I hope this short blog post highlights how affordable it is to build an online portfolio of projects to stand out to employers in such a difficult job market.

Thank you for reading!


文章来源: https://www.archcloudlabs.com/projects/running_acl_for_a_dollar_a_month/
如有侵权请联系:admin#unsafe.sh