Type object
File match fly.toml
Schema URL https://catalog.lintel.tools/schemas/schemastore/fly-io-configuration/latest.json
Source https://www.schemastore.org/fly.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Properties

files object[]
http_service object
9 nested properties
internal_port integer

The port this service (and application) will use to communicate with clients. Default is 8080.

Default: 8080
force_https boolean

A Boolean which determines whether to enforce HTTP to HTTPS redirects.

auto_stop_machines string

Whether to automatically stop or suspend an application’s Machines when there’s excess capacity, per region. Options are "off", "stop", and "suspend". If there’s only one Machine in a region, then the Machine is stopped or suspended if it has no traffic. The Fly Proxy runs a process to automatically stop Machines every few minutes. The default if not set is "off".

Default: "off"
Values: "off" "stop" "suspend"
auto_start_machines boolean

Whether to automatically start an application’s Machines when a new request is made to the application and there’s no excess capacity, per region.

min_machines_running integer

The number of Machines to keep running, in the primary region only, when auto_stop_machines is true.

concurrency object
3 nested properties
type string

Specifies what metric is used to determine when to auto start or stop, or when a given Machine should receive more or less traffic (load balancing).

Values: "connections" "requests"
soft_limit integer

When a Fly Machine is at or over this number of concurrent connections or requests, the system will deprioritize sending new traffic to that Machine.

hard_limit integer

When a Fly Machine is at or over this number of concurrent connections or requests, the system will stop sending new traffic to that Machine.

http_options object
2 nested properties
response object
2 nested properties
pristine boolean

Configures Fly Proxy to not add any Fly headers to HTTP responses.

headers Record<string, boolean | string | string[]>

Add or remove HTTP response headers.

h2_backend boolean

Indicates whether the app supports HTTP/2 cleartext (H2C) with prior knowledge or not.

tls_options object
3 nested properties
alpn string[]
versions string[]
default_self_signed boolean

When true, serve a self-signed certificate if no certificate exists. Default is false.

Default: false
checks object[]

HTTP-based health checks run against the internal_port. These checks will pass when receiving a 2xx response. Any other response is considered a failure.

primary_region string

The primary region where the application will be deployed. This setting also sets the PRIMARY_REGION environment variable.

console_command string

Command to run when you execute 'fly console'. This opens your framework's console in a new, dedicated Machine.

swap_size_mb integer

Size in megabytes for the swap file on the VM. Helps in handling memory spikes.

metrics metrics[] | metrics
http_checks object[]

HTTP-based health checks run against the internal_port. These checks will pass when receiving a 2xx response. Any other response is considered a failure.

processes Record<string, string>
app string

Fly.io application name

host_dedication_id string
vm object[]
kill_timeout integer | string

Seconds to wait before forcing a VM process to exit. Default is 5 seconds.

kill_signal string

Signal to send to a process to shut it down gracefully. Default is SIGINT.

Values: "SIGINT" "SIGTERM" "SIGQUIT" "SIGUSR1" "SIGUSR2" "SIGKILL" "SIGSTOP"
statics statics | statics[]

The statics sections expose static assets built into your application's container to Fly's Anycast network. You can serve HTML files, Javascript, and images without needing to run a web server inside your container.

services services | services[]
deploy object
5 nested properties
release_command string

Command to run after a build, with access to the production environment, but before deployment. Non-zero exit status will abort the deployment.

[deploy]
  release_command ="bundle exec rails db:migrate"
release_command_vm object

VM configuration to use when running the release command.

4 nested properties
size string
Values: "shared-cpu-1x" "shared-cpu-2x" "shared-cpu-4x" "shared-cpu-8x" "performance-1x" "performance-2x" "performance-4x" "performance-8x" "performance-16x"
memory string | integer
cpus integer
Values: 1 2 4 8 16
cpu_kind string
Values: "shared" "performance"
max_unavailable number

For rolling deploys, you can use max_unavailable to control how many Machines can be down at a time.

strategy string

Strategy for replacing VMs during a deployment.

Default: "canary"
Values: "canary" "rolling" "bluegreen" "immediate"
wait_timeout string

Timeout for waiting for the Machine to be in a started state during a deploy.

Default: "5m"
mounts mounts | mounts[]
experimental object

Flags and features that are subject to change, deprecation or promotion to the main configuration.

4 nested properties
cmd string | string[]

Override the server command (CMD) set by the Dockerfile. Specify as an array of strings:

cmd = ["path/to/command", "arg1", "arg2"]
entrypoint string | string[]

Override the ENTRYPOINT set by the Dockerfile. Specify as an array of strings:

entrypoint = ["path/to/command", "arg1", "arg2"]
auto_rollback boolean

Failed deployments should roll back automatically to the previous successfully deployed release. Defaults to true

private_network boolean

Enables private network access to the Fly organization. Defaults to true.

Default: true
env Record<string, string>

Set non-sensitive information as environment variables in the application's runtime environment. For sensitive information, such as credentials or passwords, use the secrets command. For anything else though, the env section provides a simple way to set environment variables. Here's an example:

[env]
  LOG_LEVEL = "debug"
  S3_BUCKET = "my-bucket"
build object

Build configuration options. See docs at https://fly.io/docs/reference/builders.

7 nested properties
builder string

Builder Docker image to be used with the 'buildpacks' option

buildpacks string[]

Buildpacks to be run by the 'builder' Docker image

minItems=1uniqueItems=true
args Record<string, string>

Build arguments passed to both Dockerfile and Buildpack builds. These arguments are not available on VMs at runtime.

[build.args]
  USER = "julieta"
  MODE = "production"
build-target string

Specify the target stage for multistage Dockerfile builds.

image string

Docker image to be deployed (skips the build process)

dockerfile string

Dockerfile used for builds. Defaults to './Dockerfile'

ignorefile string

A relative path to a .dockerignore file. Defaults to './.dockerignore'

Definitions

statics object
guest_path string required

The path inside your container where the assets to serve are located.

url_prefix string required

The URL prefix that should serve the static assets.

services object

Configure the mapping of ports from the public Fly proxy to your application.

You can have:

  • No services section: The application has no mappings to the external internet - typically apps like databases or background job workers that talk over 6PN private networking to other apps.
  • One services section: One internal port mapped to one external port on the internet.
  • Multiple services sections: Map multiple internal ports to multiple external ports.
script_checks

Health checks that run as one-off commands directly on the VM.

This type of check is deprecated. See tcp_checks or http_checks for alternatives.

protocol string

The protocol used to communicate with your application. Can be: tcp or udp.

Values: "tcp" "udp"
internal_port integer

The port this application listens on to communicate with clients. The default is 8080. We recommend applications use the default.

Default: 8080
auto_stop_machines string

The action, if any, that Fly Proxy should take when the app is idle for several minutes. Options are "off", "stop", or "suspend".

Default: "off"
Values: "off" "stop" "suspend"
auto_start_machines boolean

Whether to automatically start an application’s Machines when a new request is made to the application and there’s no excess capacity, per region. If there’s only one Machine in a region, then it’s started whenever a request is made to the application. The default if not set is true.

Default: true
min_machines_running integer

The number of Machines to keep running, in the primary region only, when auto_stop_machines = true.

Default: 0
concurrency object

Control autoscaling metrics (connections or requests) and limits (hard and soft).

3 nested properties
type string
Default: "connections"
Values: "connections" "requests"
hard_limit integer

When an application instance is at or over this number, the system will bring up another instance.

Default: 25
soft_limit integer

When an application instance is at or over this number, the system is likely to bring up another instance.

Default: 20
ports object[]

For each external port you want to accept connections on, add a ports section.

machine_checks object[]
tcp_checks object[]

Basic TCP connection health checks. This is the default check that runs against the configured internal_port.

http_checks object[]

HTTP-based health checks run against the internal_port. These checks will pass when receiving a 2xx response. Any other response is considered a failure.

mounts object

Mount persistent storage volumes previously setup via flyctl. Both settings are required. Example:

[mounts]
  source = "myapp_data"
  destination = "/data"
source string required

The name of the volume to mount as shown in fly volumes list.

A volume of this name must exist in each of the app regions. If there's more than one volume in the target region with the same one, one will be picked randomly.

destination string required

The path at which the source volume should be mounted in the running app VM.

snapshot_retention integer

The number of snapshots to retain for the volume. Snapshots are taken daily.

processes string[]

The name of the process(es) to which this mount should be applied. See multiple processes.

initial_size string | integer

The size of the volume to be created on first deploy.

auto_extend_size_threshold integer

The usage percentage threshold that triggers volume extension.

auto_extend_size_increment string

The size increment by which to extend the volume.

auto_extend_size_limit string

The total amount to extend a volume.

metrics object
port integer

Port on which the application exposes metrics data.

path string

Path under which the metrics are exposed, typically '/metrics'.

processes string[]

List of process names that this metrics configuration applies to.

http_checks object[]

HTTP-based health checks run against the internal_port. These checks will pass when receiving a 2xx response. Any other response is considered a failure.