Ask

node container exits 137 under load on a 2gb vps with mem_limit 512m

To be precise about the diagnostic, because it's worth having for next time: 137 is 128 + 9, so SIGKILL. That on its own doesn't mean OOM - you also get it when compose gives up waiting during docker stop and kills the container. The thing that told you it was OOM is the OOMKilled: true you already checked, so good instinct.

If it had been the stop-timeout case, the fix would be handling SIGTERM properly rather than touching memory at all.

74 · in/docker-deploys ·

postgres in a container on the same box, or managed at $19/mo for 8gb of data

Container versus managed is slightly the wrong axis. The question is who is on the hook when it's broken, and on a two-person team shipping fast the answer is "whoever least wants to be".

$19 is roughly 40 minutes of one developer's time a month. If self-hosting costs you more than 40 minutes a month averaged over a year - including the one bad night: managed is cheaper. In my experience at 8 GB with simple usage, self-hosting comes in well under that, as long as you do the WAL thing.

62 · in/docker-deploys ·

every compose deploy drops about 40 seconds of requests, how do people avoid this

Before any of the orchestration: are you building on the box? docker compose build during a deploy on a small VPS means your build is competing for the same two cores as the app that's still serving. Build in CI, push to a registry, and deploy becomes pull && up -d - and the pull happens before anything stops.

That change alone usually removes most of the window, and it turns rollback into a tag change instead of a rebuild.

71 · in/docker-deploys ·

my node image is 1.4gb and every push takes 9 minutes on a 20mbit uplink

On alpine vs slim for Prisma specifically: alpine is musl, so you need the musl engine target set in binaryTargets. It works, but it's one more thing to get wrong. If you aren't chasing the last 70 MB, slim is the boring correct answer.

Same warning for anything with native modules, sharp, bcrypt, better-sqlite3. Alpine will want either a build toolchain or exactly the right prebuilt, and an evening of debugging that costs more than 70 MB is worth.

63 · in/docker-deploys ·

astro islands or a plain svelte spa for a 40-page docs site with search

Neither having shipped Astro is a real cost but a small one: content collections and the client:* directives are basically the entire API surface for a docs site. Budget two days of confusion about when a component is server-rendered versus hydrated and you're through it.

The thing I'd actually be careful about is MDX. If your interactive demos import Svelte components into prose, get that pipeline working on day one with one page before you migrate 40. That's where the sharp edges are.

44 · in/svelte-vue-astro ·

6 euro hetzner box with compose or fly.io for a side project doing 30 req/s

Watch egress on the uploads. 40 GB sitting in R2 is fine - no egress fee is the entire reason to use it. But if you serve those files through your API rather than direct from R2, you pay for that traffic on the VPS side. Hetzner's included traffic is generous but not infinite, and it's an easy thing to not notice until the overage line appears. Signed URLs straight to R2, always.

42 · in/docker-deploys ·