Snapwake

DocsDeploying

Deploying an app

snapwake deploy takes one of three sources:

Source Command What happens
A Docker image from a registry snapwake deploy --image REF [name] the image is pulled and run as it is, like docker run
A folder with a Dockerfile snapwake deploy FOLDER [name] the Dockerfile is built inside a throwaway VM, then run
A folder Snapwake recognizes snapwake deploy FOLDER [name] Snapwake builds it the way the framework expects (Supported frameworks)

If the app doesn't exist yet, the deploy creates it. If it does, the deploy creates a new version and switches to it when the new version answers. Requests keep going to the previous version until then.

The app's name

Without a name, the app is named after the folder (My_Site becomes my-site) or after the image (ghcr.io/acme/shop:1.4 becomes shop). A snapwake.toml in the folder can set it with app = "...". A name given on the command line wins over both.

Names are lowercase letters, digits and dashes, at most 40 characters, and belong to whoever creates them first.

Deploying an image

Terminal
snapwake deploy --image nginx:alpine
snapwake deploy --image ghcr.io/mccutchen/go-httpbin
snapwake deploy --image gitea/gitea:1.22 --port 3000
  • Any registry that speaks the Docker Registry v2 API works: Docker Hub, GitHub Container Registry, Quay, Microsoft's registry, your own.
  • Every layer is checked against its sha256 digest. Layers are cached per app, so a redeploy downloads only the layers that changed.
  • The image runs with its own ENTRYPOINT, CMD, ENV, WORKDIR and USER. --start "command args" replaces both ENTRYPOINT and CMD. The string is split like a shell would split it, but no shell runs it; write --start "sh -c '...'" if you need one.
  • Folders named in VOLUME exist, but what the app writes there lives in memory until it sleeps, like the rest of its filesystem. For data that must stay, use a volume.
  • Any user may listen on ports below 1024, as in Docker. Rails 8 can run Thruster on port 80 as a non-root user.
  • The image must have a linux/amd64 variant. A multi-platform image without one is refused, and the error lists the platforms it has. An image built only for ARM, without a multi-platform index, is not caught at build time: it fails when it starts.

Which port

Snapwake sends requests to one port of your app. It uses, in order:

  1. --port N (or port in snapwake.toml);
  2. the image's only EXPOSEd port;
  3. if the image exposes several, the first web port among 80, 8080, 3000, 8000, 5000, 9000, 8443, 443; port 22 is never picked while there is another;
  4. port 8080 if the image exposes none.

The app may listen on 0.0.0.0 or 127.0.0.1. The port is reachable only from Snapwake's proxy, not from the internet.

Private images

Give the registry credentials as a secret. For a new app, put them in an env file for the first deploy, because snapwake secret works only on an app that already exists:

Terminal
echo "FLARE_REGISTRY_AUTH_GHCR_IO=myuser:ghp_xxx" > registry.env
snapwake deploy --image ghcr.io/acme/shop:1.4 shop --env-file registry.env

For an existing app, snapwake secret shop set FLARE_REGISTRY_AUTH_GHCR_IO=... before the next deploy does the same.

  • FLARE_REGISTRY_AUTH_<HOST>=user:token is used for one registry. <HOST> is the registry's host name in capitals with dots and dashes turned into underscores: GHCR_IO, DOCKER_IO, QUAY_IO, REGISTRY_EXAMPLE_COM.
  • FLARE_REGISTRY_AUTH=user:token is used only for the registry of the image you are deploying, never for the public base images it may pull from elsewhere.
  • These values go only to the build VM. They are not written into the image and your app does not see them in its environment.

Deploying a folder

Terminal
snapwake deploy .
snapwake deploy ./api api-staging
snapwake deploy . --dockerfile Dockerfile.prod --build-arg NODE_VERSION=22

The CLI packs the folder into an archive and uploads it (up to 512 MB). The app's home server unpacks and builds it inside a throwaway VM: your install and build scripts never run on the server itself.

What is not uploaded: node_modules, .next, .medusa, .git, .vercel, .netlify, .DS_Store, .env and every .env.* file. Dependencies are installed fresh during the build. Environment files are left out on purpose because they usually hold secrets; pass them with --env-file instead (see Secrets).

.dockerignore is honoured with Docker's own rules: * and ? match within one path segment, ** crosses folders, a leading / is ignored, ! brings a path back, and the last matching line wins. The Dockerfile itself is always uploaded, even if .dockerignore names it, because Docker reads it too.

Dockerfile or framework?

  • A folder with a Dockerfile and no framework Snapwake recognizes is built from the Dockerfile.
  • A folder Snapwake recognizes is built the framework's way, even if it also has a Dockerfile. Add --dockerfile Dockerfile to build from the Dockerfile instead.
  • --dockerfile path/to/file names a Dockerfile anywhere inside the folder.

Build arguments

--build-arg NAME=VALUE (repeatable, or a [build_args] table in snapwake.toml) overrides the default of an ARG in the Dockerfile, as with docker build. Up to 64 pairs. An argument the Dockerfile doesn't declare is ignored with a warning.

Your app's secrets are not visible to a Dockerfile build. Use build arguments for values the build needs.

For framework builds it is the other way round: the app's secrets and --env-file values are set as environment variables during the build, so next build can bake in NEXT_PUBLIC_* values. They are not written into the image.

What Dockerfiles can use

Snapwake runs Dockerfiles itself, without Docker, inside the build VM.

Supported Not supported yet
multi-stage builds, FROM ... AS name, FROM scratch, COPY --from=stage and --from=image RUN --mount=type=secret and type=ssh
ARG (global and per stage), ENV, WORKDIR, USER, EXPOSE, CMD, ENTRYPOINT, SHELL, VOLUME COPY --link and --parents beyond a plain copy
RUN in shell and exec form, heredocs, RUN --mount=type=cache (a secret or ssh mount is skipped with a log line and the RUN still runs, without it)
COPY and ADD with --chown, --chmod and globs; ADD of URLs and local tar archives
LABEL, STOPSIGNAL, HEALTHCHECK, ONBUILD, MAINTAINER are accepted and ignored

There is no per-step layer cache: every deploy runs the whole Dockerfile. Cache mounts (RUN --mount=type=cache,target=/root/.cache/pip ...) and the cache of base image layers are kept per app between builds and make rebuilds fast.

Build limits

Upload 512 MB after exclusions
Build VM 4 GB of memory, up to 4 CPUs, internet access only (no access to Snapwake's internal network)
Build time 20 minutes
Finished image 16 GB
Build cache kept per app between builds; another app never sees it

Builds are free during the beta. They are counted, and the Hobby plan will include 100 build minutes a month.

What happens during a deploy

  1. The CLI updates the app's settings (port, start command, memory) and, with --env-file, its secrets. Settings you don't pass keep their current values; an app deployed once as a worker stays a worker until you deploy it with --port.
  2. The home server builds the version in a throwaway VM.
  3. It boots the new version. As soon as the app answers on its port, requests switch to it; VMs of the previous version finish the requests they have and stop.
  4. In the background, the server boots the version once more, sends warm-up requests (to /, or /health for Medusa), takes the snapshot future wakes start from, and copies the version to the standby server. Then the version is ready.

The CLI returns after step 4, when the version is ready, and prints the app's URL. The new version already serves requests from step 3. If the build fails or the app never starts listening, the version is marked failed, the previous version keeps serving, and the CLI prints the reason. See Versions and rollbacks and Logs and status.

Not available through the CLI yet

These work on Snapwake's servers but can't be set from the CLI or snapwake.toml during the beta. The CLI refuses them with a message instead of ignoring them:

  • a release command (migrations run once per deploy, before the new version takes traffic);
  • TCP readiness for images that don't speak HTTP (databases, caches);
  • custom warm-up paths (the deploy warms /, or /health for Medusa), and the MCP warm-up of /mcp;
  • scheduled (cron) processes, and several processes in one snapwake.toml app.

Until release commands arrive, run migrations from your app's start command or from a one-off script against your database.