Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My poor-mans-PAAS: git, ssh, systemd, dedicated instance, caddy, grafana and prometheus

Cost per "project": domain + shared cost of the dedicated instance. Right now the dedicated instance is running 8 projects in total, I pay ~70 EUR a month, so about 8.75 EUR + .com domain for each which works out to be ~20 EUR per year, 1.6 per month. Also using Migadu for email, shared between all little projects, ~30 EUR / month (so currently 3.75 EUR per project per month).

Each project added makes cost per project lower, as they all share the same infrastructure.

Environment is setup so every service has it's own systemd user service. Deploys happen by doing the following steps:

- Build and test project locally

- Copy artifact/binary to server with ssh, rename file to be versioned incrementally

- Restart systemd service

- New service deployed

- If database migrations have to be run, I execute them here

- (if something goes wrong, I copy old artifact to "production" directory and restart service again, poors-man rollback)

- Send a marker to Grafana that a deploy have happened so it's visible in the dashboard

As it stands right now, it seems to be about 13 EUR per month per project, but as mentioned before, gets cheaper for each added service. None of them are particularly performance sensitive or use a lot of resources. As a max, I've run something like 15 services on this very machine without any problems. Everything goes via Caddy that acts like a proxy front for everything.

One of the projects got more popular one time and started impacting the performance of the others, I simply replicated exactly the same environment to a new dedicated server where it lived by itself from there on.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: