Skip to content

Latest commit

 

History

History
125 lines (82 loc) · 1.66 KB

fly-io.md

File metadata and controls

125 lines (82 loc) · 1.66 KB

Notes on Moving to Fly.io

https://fly.io/docs/rails/getting-started/migrate-from-heroku/

Setting up the accounts

$ fly launch

Environment variables

Setting secrets:

$ fly secrets set MAILGUN_API_KEY=12345

Get a list of secrets:

$ fly secrets list

Deployment

$ fly deploy

SSL certificates

$ fly certs create myapp.com

This will output the AAAA record value that you need to add to the DNS manager.

Running seeds

Make sure the system has the ALLOW_SEED env var.

$ fly secrets set ALLOW_SEEDS=true

Then run the console command:

$ fly ssh console -C "app/bin/rails db:seed" -a myapp

Get information about Redis

Get the Redis servers

$ fly redis list

Get information, including connection URL:

$ fly redis status myapp-redis

Add the Redis URL env var:

$ fly secrets set REDIS_URL=<redis_url>

Running the rails console

$ fly ssh console
$ cd app
$ bin/rails console

Scaling a VM

Get the scale of the current VMs:

$ fly scale show

Get the VM scale options:

$ fly platform vm-sizes

Changing the VM used:

$ fly scale vm dedicated-cpu-1x

Upgrading the VM memory:

$ fly scale memory 1024

Getting the scale status:

$ fly status

Connecting to REDIS

$ fly redis connect

Connecting to Fly.io Postgres

FYI: Once a secret is added to your app in Fly, it is no longer accessible with the secrets command. To view the values you need to login to the server.

$ DATABASE_URL=<db-url> fly postgres connect -a <postgres-app-name>