Framework guides
Axum
Deploy an Axum JSON API on Tokio, with a graceful shutdown on SIGTERM.
Actix Web
Deploy Actix Web 4, with its request logger and built-in graceful shutdown.
Rocket
Deploy Rocket 0.5, with the address and
PORT set from code.How Rust applications run on Sevalla
Every process (web, worker, cron job and job) runs from the same image, each with its own start command. See Processes for every process type and its settings.
Pin the Rust version
Ingot builds on Rust 1.99, its default line, unless the project sets a version. Pin the line you develop with inrust-toolchain.toml, which rustup also reads on your computer, so the build doesn’t change when a new Ingot release moves its default line:
rust-toolchain.toml
- The
INGOT_RUST_VERSIONenvironment variable, marked Available during buildtime, such as1.98. versions.rustin ingot.json.- The
channelofrust-toolchain, or ofrust-toolchain.tomlwhen there’s norust-toolchainfile. - The highest
rust-versionof the packages the build compiles, fromCargo.toml. It’s a minimum: Ingot builds on its default line when that satisfies it.
- A line, such as
1.99, builds on that line’s newest release, and every new build picks up its patch releases. - An exact release, such as
1.99.1, stays on that release, and the build log warnsRust is pinned to exactly 1.99.1, so its image won't receive security rebuilds; require 1.99.x to follow the line. stablebuilds on Ingot’s default line.nightlyorbetafails the build withrust-toolchain.toml asks for the "nightly" toolchain: Ingot builds with stable releases only.
targets and components the file lists, except the ones for development such as clippy and rustfmt, then leaves the file out of the build, so rustup doesn’t download the toolchain it names. The build plan’s Rust row shows the version and where it came from. See Set the language version.
Build with a Dockerfile
Ingot needs no Dockerfile, but you can write your own for full control of the image. A Dockerfile for Rust on Sevalla builds in arust image of the line rust-toolchain.toml pins, compiles the dependencies from Cargo.toml and Cargo.lock in a layer of their own, so a code change doesn’t compile them again, and builds with --locked. The binary links to the GNU C library, so the final stage runs on the Debian release it was built on, such as debian:trixie-slim for rust:1.99-slim-trixie, with CA certificates and a user other than root. A server that handles SIGTERM needs no init process; one that doesn’t ignores it as process 1. Each guide has one: see Deploy an Axum application.