lily.toml

Store apps, variables, ports, databases and connections of a deployment in the repository.

lily.toml contains the settings lly deploy would otherwise prompt for: which apps to build, their names, variables, ports, databases and arguments, and the connections between apps. With the file in the repository, every deploy uses the same configuration, locally and in CI.

lly init and lly deploy read ./lily.toml from the current directory. --config <FILE> reads another file.

Example

lily.toml
[project]
name = "shop"                       # only used for new projects

[apps."apps/web"]                   # one section per root
name = "web"
ports = [{ port = 3000, proto = "http" }]
databases = ["postgres"]

[apps."apps/web".env]
NODE_ENV = "production"
SESSION_SECRET = { secret = true }  # not sent; the value is set on LILY

[apps."services/api"]
name = "api"
ports = [8080]
args = ["--config", "prod"]

[[edges]]
from = "apps/web"
to = "services/api"
port = 8080

Reference

[project]

KeyDescription
nameProject name for new projects. Ignored for existing projects.

[apps."<root>"]

The key is the root of an app, the directory in which LILY detected it. An app in the repository root has the root ".". lly source show lists the roots of a scanned repository. Only roots listed in the file are deployed.

KeyDescription
nameApp name. Default: last directory of the root, or the repository name for ".".
portsService ports, as numbers ([8080]) or tables ({ port = 3000, proto = "http" }). proto: http, https, tcp or udp.
databasesDatabases: postgres, mysql, mariadb, redis, mongodb or sqlite
argsStart arguments. Stored with the app, not applied at startup yet.

[apps."<root>".env]

Environment variables as KEY = "value". { secret = true } marks a required secret. It is not sent with the deploy and has no value in the file.

[[edges]]

Each entry allows one app to call another. Apps without an edge cannot reach each other. See Networking.

KeyDescription
fromRoot of the calling app
toRoot of the called app
portAllowed port. Optional. Default: the service port of the called app.

Precedence

Command-line flags take precedence. If --env, --port, --db or --args name a root, the section of that root in the file is ignored completely. Roots not named by flags are read from the file. Edges from flags and file are combined.

Write the file

--save writes the settings of a deploy to lily.toml, or to the --config path:

lly deploy --apps apps/web --port apps/web=3000 --db apps/web=postgres --save

The file contains the project name, app names, and the ports, databases, arguments, variables and edges from flags or an existing lily.toml. Proposals from the analysis and values entered at prompts are not written. --save overwrites the whole file. Secret markers and edge ports in the existing file are lost and must be added again.

On this page