Skip to content

add fly.io config files #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2025
Merged

add fly.io config files #39

merged 1 commit into from
Apr 10, 2025

Conversation

skpy
Copy link
Collaborator

@skpy skpy commented Apr 7, 2025

I've moved hosting of the app from my personal VPS to https://fly.io/. This affords a few benefits:

  • I can perform maintenance on my VPS without worrying about interrupting a game
  • fly provides basic Grafana metrics as part of the default offering
  • fly supports live and historical logs, which can be accessed via the fly.io console without logging into the running app
  • fly supports "teams" which means I can add glocke and anyone else to join the team to see and manage the apps
  • fly supports GitHub integrations which we may use to automatically build and deploy new instances of the app upon commit or merge

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:

  • fly-dev.toml: the config for icvtt-dev.fly.dev (DNS CNAME'd to dev.icvtt.net). This uses a 256MB shared CPU VM.
  • fly-prod.toml: the config for icvtt.fly.dev (DNS CNAME'd to app.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:

fly deploy -a icvtt -c fly-prod.toml # build and launch the prod app
fly deploy -a icvtt-dev -c fly-dev.toml # build and launch the dev app

@cgloeckner cgloeckner merged commit 7e99c2b into master Apr 10, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants