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
| Flag | Default | Description |
|---|---|---|
| -d, --detach | – | Start in the background and return once everything is healthy. |
| -p, --profile <name> | default | Apply 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> | .env | Load 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> | missing | When to pull base images: missing, always or never. |
| --timeout <duration> | 60s | How 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 -dStart only the API and the database it depends on, without watching files:
$ gantry up api --no-watchUse the CI profile and fail fast when a service takes more than 30 seconds to get healthy:
$ gantry up --profile ci --timeout 30s -dExit codes
| Code | Meaning |
|---|---|
| 0 | Success: everything started and is healthy (with -d), or stopped cleanly. |
| 1 | A build failed. The build log is printed above the error. |
| 2 | gantry.toml is invalid. The message points at the file and line. |
| 3 | A health check didn't pass within --timeout. |
| 130 | Interrupted with Ctrl C. |
Building without starting anything? See gantry build.