Skip to content

gantry up

Build what changed, start every service in dependency order and wait for health checks. Watches your source and rebuilds on save.

CLI referenceUpdated 30 Sep 20264 min read

Usage

$ gantry up [service...] [flags]

Description

gantry up builds every service whose inputs changed, starts services in dependency order, and waits for each one's health check before starting anything that depends on it. Name services to start just those and whatever they depend on.

In the foreground it streams logs from every service, prefixed with the service name, and rebuilds on save. Press Ctrl+C once to stop gracefully and twice to stop immediately.

Options

FlagDefaultDescription
-d, --detach–Start in the background and return once everything is healthy.
-p, --profile <name>defaultApply a profile from gantry.toml.
--port <svc=host:ctr>–Publish a service on a different host port for this run. Repeatable.
-e, --env <KEY=value>–Set an environment variable for every service. Wins over all other sources.
--env-file <path>.envLoad variables from another file.
--no-watch–Don't rebuild on file changes. Implied by -d.
--rebuild–Ignore cached layers for the services being started.
--pull <when>missingWhen to pull base images: missing, always or never.
--timeout <duration>60sHow long to wait for each health check.
-q, --quiet–Only print errors and the final status line.

Examples

Start everything in the background:

$ gantry up -d

Start only the API and the database it depends on, without watching files:

$ gantry up api --no-watch

Use the CI profile and fail fast when a service takes more than 30 seconds to get healthy:

$ gantry up --profile ci --timeout 30s -d

Exit codes

CodeMeaning
0Success: everything started and is healthy (with -d), or stopped cleanly.
1A build failed. The build log is printed above the error.
2gantry.toml is invalid. The message points at the file and line.
3A health check didn't pass within --timeout.
130Interrupted with Ctrl C.

Building without starting anything? See gantry build.