You deploy a small worker on a free server. It runs fine for a week.
Then the host restarts, and the worker wakes up confused.
This post is about that morning. Not the deploy. The wake-up.
The claim I keep hearing
"It's just a tiny script. Local files are enough."
That sentence is usually true until the first restart.
Free hosts are cheap because something is disposable. Usually it is you.
Below are four myths, the corrected mental model, and a drill you can adapt.
All code here is illustrative . I did not execute it for this article.
Myth 1 β "The disk is a database"
The claim: writes to /data or ./state survive anything.
Why it breaks: a container's writable layer belongs to that container.
Destroy the container and the layer goes with it.
The Twelve-Factor App calls this out under processes : processes are stateless, and state belongs in a backing service.
Docker's storage documentation describes the writable layer the same way.
Corrected model: local disk is a cache , not a source ofβ¦