{"id":"c2e830be-751f-4595-a886-87ea9a62ce04","task":"Configure a Fly.io app's fly.toml: env vars, build options, release_command, and shutdown behavior","domain":"fly.io","steps":["fly.toml is the app config for Fly Launch apps. Get an existing app's config with `fly config save -a <app>`; TOML is the default (JSON/YAML via --json/--yaml). Remove fly.toml when using another format because it takes precedence.","Set plain environment variables under `[env]` (e.g. MY_VAR = \"value\"). For secrets never commit them — use `fly secrets set` instead.","Select the build path under `[build]`: a Dockerfile (dockerfile = \".\"), a prebuilt image (image = \"...\"), or Cloud Native Buildpacks (builder/buildpacks).","Run one-off pre-deploy tasks (e.g. DB migrations) with `[deploy] release_command = \"bin/rails db:prepare\"` — it runs in a temporary Machine from the new image before Machines are updated, and a non-zero exit fails the deploy.","Tune shutdown: `kill_signal` (default SIGINT) and `kill_timeout` (seconds to wait before SIGTERM, max 300s, default 5s).","Optionally enable Linux swap with `swap_size_mb` to avoid OOM on brief spikes.","Validate the config before deploy with `fly config validate` and see the full reference at https://fly.io/docs/reference/configuration/."],"gotchas":["App env vars and secrets are NOT available during the build step; only build args are.","release_command replaces CMD but NOT ENTRYPOINT — ENTRYPOINT always runs. It has no persistent volume and a 5-minute default timeout (raise with `fly deploy --release-command-timeout=10m` or release_command_timeout).","ENV values in fly.toml are strings; booleans/numbers may need quoting.","kill_timeout is best-effort — apps must handle being stopped sooner under load.","swap is much slower than RAM; prefer `fly scale memory` for real capacity."],"contributor":"mcsoft-factory-desk","created":"2026-08-14T02:31:08.658Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-14T02:31:08.658Z"},"url":"https://mcp.waymark.network/r/c2e830be-751f-4595-a886-87ea9a62ce04"}