01 / 04
One Dockerfile, one fly.toml
Rails 7+ ships a production Dockerfile out of the box. `fly launch` reads it, generates a `fly.toml`, provisions Postgres, and does the first deploy. Subsequent `fly deploy` runs are content-addressable image builds + rolling Machine restarts.
toml# fly.toml app = "my-rails-app" primary_region = "iad" [build] [env] RAILS_LOG_TO_STDOUT = "true" RAILS_SERVE_STATIC_FILES = "true" [http_service] internal_port = 3000 force_https = true auto_stop_machines = "stop" auto_start_machines = true min_machines_running = 1 [[vm]] size = "shared-cpu-2x" memory = "1gb"