Due to my love to shiny things, I keep wanting to find an excuse to move to a PaaS but I can never find a sufficient justification.
- Figured I'd need to screw with Systemd at some point. Nope, whatever Docker's doing restarts my services on a system restart, and auto-restarts if they break. I haven't had to lift a finger for any of that. My services are always just there, unless something really goes horribly wrong.
- Which directories I need to backup is documented in the shell scripts themselves. Very clear and easy.
- Moving those directories and my shell scripts to another server, potentially with a different distro, would be trivial. Rsync two directories (I've put all the directories I mount in the docker images, under a single directory for convenience), shell in, run the scripts. Writing a meta-script to run all of them would be easy. On a VPS I could have everything that mattered on a network drive, and that'd make it even simpler. Mount network drive, run script(s).
- Version updates are easy. I can switch between "use the latest" and "use this specific version until I say otherwise" at will. Rollbacks are trivial. If the services were public-facing I could automate a lot of this with maybe an hour of effort.
- Port mapping's covered by Docker. If these were public-facing it'd be pretty easy to add one extra container for SSL certs and termination (probably Caddy, because I'm lazy, though historically my answer for this at paying gigs has been haproxy). Like, truly, the degree to which I can interact with and configure this system entirely by using portable-everywhere docker commands & config is very high.
I've been running servers (sometimes private, sometimes public) at home since like 2000, and this is easily my favorite approach I've used so far.
I've used stuff like Dokku at work. I dunno—it's another thing that can and does break. If you're just self-hosting a few services and aren't trying to coordinate the work of several developers, IMO it's simpler and not-slower to just use Docker directly.
Would love to hear more about how Dokku broke as it will help me polish the project further :)
It was plenty solid, but I’ve definitely seen it fall victim to operator error :-) I’d certainly consider using it again to support a team, under the right circumstances.
I find this true of pretty much all modern cloud development. So many people want to just pretend it’s another VPS alternative and are shocked that their misuse leads to high monthly bills. You need different patterns to take advantage of the strengths of PaaS cloud services and to avoid the weaknesses and gotchas. I PaaS all of the things that I can and my maintenance and support efforts have never been lower. My services scale to zero and I only pay for actual utilization.
If you’re standing up a lot of VMs in the cloud and pretending it’s just another data center of course you’re going to have a bad time and waste money.
I'm now running my primary project on Fly.io and I'm pretty happy with it overall.
"No matter how small is the service, no matter how rarely you need it, you’d need to pay the full price."
On Fly.io I'm running an app server, a db server, and another app server with a 1GB volume for a Discord bot. Everything fits in the free plan.
The thing about PaaS is you really have to do your research. It's not like VPS providers where all you really need to look at is how much compute and storage you get for a monthly price. PaaS have a lot more subtleties and yes, it happens that the startups behind them sometimes blow up or get bought out by huge public enterprise companies. VPS providers tend to be lower risk.
The tradeoff is worth it for me, but it really depends on your skillset, your priorities and so on. I can maintain a VPS, but I have very limited time, so I want to focus every spare hour I have on developing my product.