refrakt_cli/deploy

refrakt gen deploy [--fly]: a Dockerfile, a .dockerignore and, with --fly, a fly.toml for the app in the current directory.

The Dockerfile builds an Erlang shipment (gleam export erlang-shipment) and runs it on a slim Erlang image. Apps with a database also get bin/migrate, which runs src/<app>/migrate.gleam from the shipment, since gleam run is not available there.

Existing files are never overwritten: each one is either written or reported as skipped.

Values

pub fn dockerfile(
  app: String,
  db: types.DbChoice,
  health_path: String,
) -> String
pub fn dockerignore() -> String
pub const erlang_version: String

The Erlang/OTP release that Gleam image is built on. The runtime image, erlang:<version>-alpine, must run the same release.

pub fn fly_toml(
  app: String,
  db: types.DbChoice,
  health_path: String,
) -> String
pub const gleam_version: String

The Gleam image the Dockerfile builds with, ghcr.io/gleam-lang/gleam:v<version>-erlang-alpine.

pub fn migrate_script(app: String) -> String

bin/migrate: run the app’s migrate module from the shipment.

pub fn run(args: List(String)) -> Nil
pub fn satisfies(version: String, requirement: String) -> Bool

Whether version (such as “1.19.2”) meets a gleam.toml requirement such as “>= 1.14.0” or “>= 1.14.0 and < 2.0.0”. A requirement this cannot read counts as met.

✨ Search Document