A First Look at Fly
Published:
Fly is a platform for fullstack applications and databases build with Dockerfiles or Buildpacks that need to run globally.
Outline
All of this project’s code can be found in the First Look monorepo on my GitHub.
Introduction
Fly is a platform for fullstack applications and databases that need to run globally. Fly executes your code close to users and scales compute in cities where your app is busiest. You can run arbitrary Docker containers and host popular databases like Postgres.
Fly Setup
Install flyctl
You can download the CLI on Mac, Linux, or Windows.
Create Fly Account
If you are a new user you can create an account with flyctl auth signup
.
After your browser opens you can either:
- Sign-up with your name, email and password.
- Sign-up with GitHub and check your email for link to set a password for verification.
You will also be prompted for credit card payment information, required for charges outside the free plan on Fly. See Pricing for more details.
Login to Fly Account
If you already have an account you can login with flyctl auth login
.
After your browser opens, sign in with your username and password. If you signed up with GitHub, use the Sign-in with GitHub button to sign in.
Create Project
Create Server
Run Server
Create Dockerfile
Add the following code to Dockerfile
in the root directory of your project.
Add the following code to .dockerignore
in the same directory as your Dockerfile
.
Launch Application on Fly
Run flyctl launch
in the directory with your source code to configure your app for deployment. This will create and configure a fly app by inspecting your source code and prompting you to deploy.
This creates a fly.toml
file.
Add the following PORT
number under env
.
Deploy Application
Show Current Application Status
Status includes application details, tasks, most recent deployment details and in which regions it is currently allocated.
Open your browser to current deployed application with flyctl open
.
Visit your link (ajcwebdev-fly.fly.dev
in my case) to see the site.