
flyctl, our CLI app for managing apps. If you’ve already installed it, carry on. If not, hop over to our installation guide. Once that’s installed you’ll want to log in to Fly.
Once you have logged on, here are the three steps and a recap.
Rails Splash Screen
A newly generated Rails application will display a flashy splash screen when run in development, but will do absolutely nothing in production until you add code. In order to demonstrate deployment of a Rails app on fly, we will create a new application, make a one line change that shows the splash screen even when run in production mode, and deploy the application.Create an application
Start by verifying that you have Rails installed, and then by creating a new application:config/routes.rb:
Launch
To configure and launch the app, you can usefly launch and follow the
wizard. This demo does not need a database or redis.
Arrived at Destination
You have successfully built, deployed, and connected to your first Rails application on Fly. We’ve accomplished a lot with only just one line of code and just one command. Now that you have seen it up and running, a few things are worth noting:- No changes were required to your application to get it to work.
- Your application is running on a VM, which starts out based on a
docker image. To make things easy,
fly launchgenerates aDockerfileand abin/docker-entrypointfor you which you are free to modify. - As your application needs change, you can have us update your
Dockerfilesfor you by running:bin/rails generate dockerfile. - There is also a
config/dockerfile.ymlfile which keeps track of your dockerfile generation options. This is covered by the FAQ. - Other files of note:
.dockerignoreandfly.toml, both of which you can also modify. All five files should be checked into your git repository. fly dashboardcan be used to monitor and adjust your application. Pretty much anything you can do from the browser window you can also do from the command line usingflycommands. Tryfly helpto see what you can do.fly ssh consolecan be used to ssh into your VM.fly consolecan be used to open a rails console.