add fly.io config files #39
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've moved hosting of the app from my personal VPS to https://fly.io/. This affords a few benefits:
Right now, I'm having fly build the container image when we deploy. This could be eliminated if we build (manually or via GitHub Actions) and push to a public registry (presumably GitHub?). Then fly could pull the referenced image and save some deploy time.
Included in this PR are two files:
icvtt-dev.fly.dev
(DNS CNAME'd todev.icvtt.net
). This uses a 256MB shared CPU VM.icvtt.fly.dev
(DNS CNAME'd toapp.icvtt.net
). This uses a 512MB shared CPU VM.Both are configured to suspend after no activity. The default is, I think, 5 minutes. We can extend that, or turn it off entirely, as desired.
Each app has secrets defined for the OAuth secrets. These get injected into the runtime environment. That keeps secrets out of version control.
Each app has a dedicated fly volume attached to it for persistent data (SQLite DBs, user uploads). dev has a 1GB volume and prod has a 4GB volume. We can extend these as needed (and I think they'll extend automatically. They can never be reduced).
If you make a code change or a config change, you can build and deploy it with the fly CLI. You'll need to pass the app name and the config file to use: