gleam export erlang-shipment, and runs it on the Erlang virtual machine (the BEAM) as processes. The web process runs the main function of your project, background workers and cron jobs can run other modules of the same project, and jobs run migrations before each deployment.
Framework guides
Wisp
Deploy a Wisp JSON API on Mist, with a secret key and a graceful shutdown on Erlang/OTP 29.
How Gleam applications run on Sevalla
Every process (web, worker, cron job and job) runs from the same image, each with its own start command. Sevalla runs a custom start command with
/bin/sh -l -c, which expands /app/*/ebin to every package’s folder, and exec makes the BEAM receive SIGTERM. See Processes for every process type and its settings.
Pin the Gleam version
Ingot builds with the newest Gleam release it knows, 1.19.2 with Ingot v0.4.1, unless the project asks for another. Gleam publishes its images for exact releases, so a new Ingot release moves the build to the newest Gleam release, and to the Erlang/OTP release that Gleam’s image comes with. Ingot takes the version from the first of these that’s set:- The
INGOT_GLEAM_VERSIONenvironment variable, marked Available during buildtime, orversions.gleamin ingot.json. - The
gleamline of.tool-versions, then mise’s configuration, in the build path or a folder above it up to the repository root. - The
gleamrequirement ingleam.toml, such asgleam = ">= 1.19.0", which the Gleam compiler also checks. Clauses join withand; a requirement withorfails the build.
- A requirement, such as
>= 1.19.0ingleam.toml, builds with the newest release Ingot knows that meets it. The build plan’s Gleam row shows1, the line, and where the requirement came from. - An exact release, such as
gleam 1.19.2in.tool-versions, stays on that release, and the build log warns that its image won’t receive security rebuilds. - A release newer than every one Ingot knows fails the build, for example
gleam.toml gleam: no gleam version in this Ingot release satisfies ">= 1.30.0" (newest known: 1.19.2).
Build with a Dockerfile
Ingot needs no Dockerfile, but you can write your own for full control of the image. A Dockerfile for Gleam on Sevalla builds in the Gleam team’sghcr.io/gleam-lang/gleam image of the release you develop with, copies gleam.toml and manifest.toml and runs gleam deps download before it copies the code, so a code change reuses the downloaded packages, then runs gleam export erlang-shipment. The final stage copies only the shipment into the slim official erlang image of the same Erlang/OTP release, sets LANG=C.UTF-8, runs as a user other than root, and starts entrypoint.sh, which replaces itself with the BEAM: it handles SIGTERM itself, so it needs no init process. See Deploy a Wisp application.