Snapwake

DocsReference

Moving from Fly.io, Heroku, Render or Docker Compose

If your app has a Dockerfile or runs from a public image, it will most likely run on Snapwake as it is. Start with:

Terminal
snapwake import .        # writes snapwake.toml from fly.toml, docker-compose.yml or Procfile
cat snapwake.toml        # read the comments it left
snapwake deploy . --env-file .env.production

Then go through the notes for your platform below.

Things that work differently everywhere

  • Apps sleep by default. Ten seconds without traffic and the app sleeps; the next request wakes it in tens of milliseconds. For something that must never wait, snapwake scale <app> --min 1.
  • Memory doesn't survive sleep unless the app has a volume. In-memory sessions, caches and files written to the container's filesystem are reset to the deploy snapshot. See How Snapwake works.
  • One process per app. A web process and a worker become two apps deployed from the same source.
  • No release command yet. Run migrations from your start command (sh -c "npm run migrate && npm start") or from a one-off script.
  • No scheduled jobs yet. Use an external scheduler that calls an endpoint, or enqueues a job for a queue worker.
  • Inbound traffic is HTTP only, and there are no WebSockets through the public URL yet.
  • No managed databases yet. Use a hosted Postgres or Redis with a public address (Neon, Supabase, Upstash, your provider's managed service), or SQLite on a volume.
  • No custom domains or static outbound IPs yet.
  • One region during the beta.
  • Images must be linux/amd64.

From Fly.io

Fly.io Snapwake
fly.toml snapwake import . translates the app name, build, env, internal port, VM memory and the web process
auto_stop_machines / min_machines_running sleep is the default; snapwake scale --min N for always-on
fly secrets set snapwake secret <app> set
[[mounts]] and volumes snapwake deploy --volume NAME:/PATH:MB; copy the data over yourself (see below)
[deploy] release_command not available yet; import writes it as [release], which you must remove for now
[processes] beyond web/app deploy each as its own app; queue workers with --worker
<app>.internal, .flycast http://<app>.internal, HTTP only; raw TCP between apps is not available
HTTP checks snapwake health <app> --path /healthz
regions one region

From Heroku

Heroku Snapwake
Procfile web: snapwake import . uses it as the start command
release: not available yet; remove the [release] table import writes
worker: and other dynos a second app with --worker "..."; with a Redis queue it can sleep
config vars heroku config -s -a myapp > .env.production, then snapwake deploy . --env-file .env.production
buildpacks Node.js and Python are detected (Supported frameworks); other languages need a Dockerfile
Heroku Postgres works over the internet with SSL; the Postgres pool takes the reconnection cost off each wake
Heroku Scheduler an external scheduler for now

From Render

Render Snapwake
web service (Docker or native runtime) snapwake deploy .; native Node.js and Python are detected, everything else via Dockerfile
background worker an app with --worker "..."
cron job not available yet
persistent disk --volume
environment groups an env file per app with --env-file
health check path snapwake health <app> --path ...

From Docker Compose

snapwake import . turns each service into an app in one snapwake.toml ([apps.<service>]), and snapwake deploy . deploys them one after another.

Compose Snapwake
image, build (context, Dockerfile) the same
ports the first port becomes the app's port
command command (replaces both ENTRYPOINT and CMD; check it if the service also sets entrypoint)
environment [env]
env_file --env-file on deploy
depends_on and service names like api:8000 call other apps at http://<app>.internal (HTTP, port 80)
a postgres, redis, mysql or mongo service it deploys, but your other apps can't reach it over TCP yet; use a hosted database
volumes --volume on deploy
healthcheck snapwake health

Copying data into a volume

There is no command to upload files into a volume yet. Two ways that work:

  • have the app download its data on start when the volume is empty (from S3, R2 or a URL you control), then remove that code;
  • for SQLite, upload the database file to object storage and fetch it the same way, or replay a dump through your app.

Checking the move

  1. Deploy, then call a few endpoints.
  2. Let the app sleep (wait longer than 10 seconds), and call them again: they should answer correctly after the wake, with the right time and fresh random values.
  3. Check snapwake logs <app> for reconnection errors after the wake.
  4. If anything misbehaves only after a wake, see Sleep and wake.