tori deploy
Pack a directory, build a service from source, or run a digest-pinned image, and wait until it is live.
npx tori.host deploy [dir]Put a new version of this app live. A static site is packed out of [dir] and uploaded as files. A service is built on Tori from the source tree in [dir] — a Dockerfile if there is one, else a detected language — or runs a container image a registry already has. A directory and --image are contradictory instructions, so passing both is an error rather than a guess.
The app is read from ./tori.json — or from [dir]/tori.json when [dir] was bound on its own — and its kind decides what [dir] is: files to serve for a static site, source to build for a service. With no tori.json a new app is created and the file is written: a service for --service, --image or a directory with a Dockerfile at its root; a static site otherwise. A service built from source gets its tori.json inside the packed directory. Which of the two an app is cannot be changed afterwards.
A source upload leaves out .git, node_modules and whatever .gitignore matches — every .gitignore git itself reads, from the repository root down. .dockerignore is applied by the build, next to the Dockerfile, not here. The plan caps the compressed upload and the build time; the server names the cap when it is hit.
<ref> must be pinned to a digest — registry/repo@sha256:<64 hex>. A tag is refused before any request is made: it can be moved onto different bytes tomorrow, so it cannot identify what was deployed. Resolve one with
docker inspect --format "{{index .RepoDigests 0}}" <image>
Ctrl+C stops watching. It does not cancel the deployment on the server.
A service deploy can run a release command (tori.json "release" or --release) as a Job before the new revision takes traffic. The Job is bounded at 10 minutes and that bound is not adjustable. If that Job fails or times out, the previous revision keeps serving. Database changes the command already applied are not rolled back — keep schema changes backward-compatible with the revision that is still live. A Prisma/Alembic/Drizzle tree without "release" only prints a hint; it does not run a Job. Rollback of a deploy that had a release command runs that same command again. Cancel does not kill a still-running Job; the command is allowed to finish.
Options
Section titled “Options”[dir]— Directory to pack: static files for a static site, the source tree for a service. Incompatible with--image.--service— Build a service from the source in [dir] and run it. Creates a service app when there is no tori.json. Contradicts--image.--image <ref>, --image=<ref>— Deploy a container image the registry already has. <ref> must be digest-pinned: registry/repo@sha256:<64 hex>. A tag is refused locally.--restart— Force a new revision when the image and env are already live. Only applies with--image.--release <command>, --release=<command>— Command to run as a Job after the image is ready and before the new revision takes traffic. argv as a string, for example "npx prisma migrate deploy". Also read from tori.json "release". Not inferred from the tree: a Prisma/Alembic/Drizzle layout only prints a hint.-v, --verbose— show deployment diagnostics and phase timings--no-browser— sign in with a code you type on another device (chosen automatically over SSH or with no DISPLAY)
Subcommands
Section titled “Subcommands”tori deploy status— inspect the latest or named deploymenttori deploy watch <id>— resume watching a deploymenttori deploy cancel <id>— cancel a pending service deployment; keep the live versiontori deploy build-log— print the build log of a source deployment
Environment
Section titled “Environment”TORI_DEPLOY_TIMEOUT_MS(default: 20m) — how long to wait for the deploy to settleTORI_UPLOAD_TIMEOUT_MS(default: 20m) — how long one artifact upload may lastTORI_UPLOAD_STALL_MS(default: 120s) — give up if the connection accepts no bytes for this longTORI_CANCEL_TIMEOUT_MS(default: 2m) — how long tori deploy cancel waits for a running build to settle
Examples
Section titled “Examples”Deploy the current project
Section titled “Deploy the current project”npx tori.hostBuild and run the current directory as a service
Section titled “Build and run the current directory as a service”npx tori.host deploy --serviceDeploy a digest-pinned service image
Section titled “Deploy a digest-pinned service image”npx tori.host deploy --image registry.example.com/acme/api@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855This reference matches tori.host@0.9.7.
Download this page as Markdown.