fly.io Configuration
fly.io, a cloud provider, configuration
| 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
Properties
9 nested properties
The port this service (and application) will use to communicate with clients. Default is 8080.
A Boolean which determines whether to enforce HTTP to HTTPS redirects.
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".
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.
The number of Machines to keep running, in the primary region only, when auto_stop_machines is true.
3 nested properties
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).
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.
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.
2 nested properties
2 nested properties
Configures Fly Proxy to not add any Fly headers to HTTP responses.
Add or remove HTTP response headers.
Indicates whether the app supports HTTP/2 cleartext (H2C) with prior knowledge or not.
3 nested properties
When true, serve a self-signed certificate if no certificate exists. Default is false.
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.
The primary region where the application will be deployed. This setting also sets the PRIMARY_REGION environment variable.
Command to run when you execute 'fly console'. This opens your framework's console in a new, dedicated Machine.
Size in megabytes for the swap file on the VM. Helps in handling memory spikes.
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.
Fly.io application name
Seconds to wait before forcing a VM process to exit. Default is 5 seconds.
Signal to send to a process to shut it down gracefully. Default is SIGINT.
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.
5 nested properties
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"
VM configuration to use when running the release command.
4 nested properties
For rolling deploys, you can use max_unavailable to control how many Machines can be down at a time.
Strategy for replacing VMs during a deployment.
Timeout for waiting for the Machine to be in a started state during a deploy.
Flags and features that are subject to change, deprecation or promotion to the main configuration.
4 nested properties
Override the server command (CMD) set by the Dockerfile. Specify as an array of strings:
cmd = ["path/to/command", "arg1", "arg2"]
Override the ENTRYPOINT set by the Dockerfile. Specify as an array of strings:
entrypoint = ["path/to/command", "arg1", "arg2"]
Failed deployments should roll back automatically to the previous successfully deployed release. Defaults to true
Enables private network access to the Fly organization. Defaults to true.
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 configuration options. See docs at https://fly.io/docs/reference/builders.
7 nested properties
Builder Docker image to be used with the 'buildpacks' option
Buildpacks to be run by the 'builder' Docker image
Build arguments passed to both Dockerfile and Buildpack builds. These arguments are not available on VMs at runtime.
[build.args]
USER = "julieta"
MODE = "production"
Specify the target stage for multistage Dockerfile builds.
Docker image to be deployed (skips the build process)
Dockerfile used for builds. Defaults to './Dockerfile'
A relative path to a .dockerignore file. Defaults to './.dockerignore'
Definitions
The path inside your container where the assets to serve are located.
The URL prefix that should serve the static assets.
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.
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.
The protocol used to communicate with your application. Can be: tcp or udp.
The port this application listens on to communicate with clients. The default is 8080. We recommend applications use the default.
The action, if any, that Fly Proxy should take when the app is idle for several minutes. Options are "off", "stop", or "suspend".
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.
The number of Machines to keep running, in the primary region only, when auto_stop_machines = true.
Control autoscaling metrics (connections or requests) and limits (hard and soft).
3 nested properties
When an application instance is at or over this number, the system will bring up another instance.
When an application instance is at or over this number, the system is likely to bring up another instance.
For each external port you want to accept connections on, add a ports section.
Basic TCP connection health checks. This is the default check that runs against the configured internal_port.
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.
Mount persistent storage volumes previously setup via flyctl. Both settings are required. Example:
[mounts]
source = "myapp_data"
destination = "/data"
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.
The path at which the source volume should be mounted in the running app VM.
The number of snapshots to retain for the volume. Snapshots are taken daily.
The name of the process(es) to which this mount should be applied. See multiple processes.
The size of the volume to be created on first deploy.
The usage percentage threshold that triggers volume extension.
The size increment by which to extend the volume.
The total amount to extend a volume.
Port on which the application exposes metrics data.
Path under which the metrics are exposed, typically '/metrics'.
List of process names that this metrics configuration applies to.
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.