Hosting a Static Site in the Silliest Way Possible (Part 2)
Now that I can build my static site and serve it up using Caddy inside a docker container, it’s time to publish it to a server on the internet. If I didn’t want to host other things with it, at this point, I’d just stop and throw it on a static host somewhere, either like github pages, gitlab pages or sourcehut pages. Or a shared hosting space at nearlyfreespeech.net. But I want to publish some larger file downloads also, and those are a poor fit for the software forges. They’d be a fine fit for nearlyfreespeech.net, but would increase my storage and transfer bill there while I’m under-using my VPS with plenty of space and transfer capacity. Paying to move the downloads to NFSN wouldn’t let me reduce the VPS size or decommission it, so using the VPS feels like a better option. Here’s how I’m using kamal to do that.
Hosting a Static Site in the Silliest Way Possible (Part 1)
Over the past several months, I’ve opened up to the idea of using ansible and kamal to manage VPSes where I host sites that I want to make accessible to the public. Now, I’m setting up a new service that includes a basic static site, where I need a way to easily share files with people. For other similar static sites, I’ve been using a shared host or my git forge’s “pages” service. But these files are not source code and are larger than I want to put on the git forge, and my VPS has plenty of space; I’d rather not pay for the space for them on my shared host.
So since I’m already using kamal on the VPS I’m already paying for, I’ve decided to host a static site in what might be the silliest way possible.
PSA: Docker Will Edit Host-Based Firewall Rules For You
Over the past week or so, I’ve been trying out using Docker to deploy a Django site on a VPS. My preferred setup for that is to have Caddy running on the host, not in any container, as a reverse proxy. (It’s a single, static binary; I don’t see any joy in wrapping that in a container.) In the past when I’ve hosted similar things, I just ran gunicorn in a python virtualenv on the host as well, and bound it to the loopback. The current thing I’m building is a little bit more painful to run that way on my VPS, so I thought I’d finally cave and give Docker a try in “production.” While there was quite a bit to like about it, there was also an unpleasant surprise.