New:New releases:CLIcreate-clubedge-app v0.49.1·Clubedge Starter v0.32.0

Clubedge Starter Docs

Fly.ioExperimental

Deploy to Fly.io with one command, with Fly's Postgres and Upstash Redis or your own databases.

In a project with deploy fly (CLI 0.25.0 or newer), pnpm clubedge deploy uses Fly's CLI and your Fly login:

pnpm clubedge add deploy fly   # if the project deploys elsewhere today
pnpm clubedge deploy

Install Fly's CLI first: it is not on npm, so deploy can't download it for you.

What it does

  1. Signs in with fly auth login, which opens the browser when you are signed out. With FLY_API_TOKEN set, it skips this.
  2. Creates or reuses the app in your personal organization. fly launch writes the app's name (the package name and a short suffix, since Fly names are global) and region into fly.toml; commit it.
  3. Creates the databases unless your env file points them elsewhere: an unmanaged Postgres app, <app>-db (one shared-cpu-1x machine and a 1 GB volume), attached so it sets DATABASE_URL, and with cache redis, Upstash Redis <app>-redis as REDIS_URL.
  4. Imports the secrets: APP_URL and NEXT_PUBLIC_APP_URL as https://<app>.fly.dev, a BETTER_AUTH_SECRET that later runs keep, CLIENT_IP_HEADER=fly-client-ip, where the client's address is (CLI 0.42.0 or newer), and the env file's values. The ones still unset are listed before the build.
  5. Runs fly deploy with NEXT_PUBLIC_APP_URL as a build argument: Fly builds the Dockerfile, runs the migrations as the release command, and waits for the health checks on /api/health.

Costs

Fly bills the app, Postgres, and Redis on your plan. Fly's Managed Postgres starts at $38 a month, so deploy uses unmanaged Postgres; for Managed Postgres, create it with fly mpg create, attach it with fly mpg attach, then run deploy.

When a deploy fails

fly logs --app <app> shows why: a failed migration in the release command, or a health check that never passed. Fix the cause and run deploy again, which reuses what exists.

To set up Fly.io without this command, see Fly.io in the deploy guide.

How is this guide?