Skip to main content

Prerequisites

Deploy flow

1

Configure secrets and variables

Set all required runtime values in Fly.io using the dashboard or flyctl secrets set.
2

Deploy an immutable image

Deploy the application image with infra/fly/fly.toml.
flyctl deploy \
  --app <fly-app-name> \
  --config infra/fly/fly.toml \
  --image ghcr.io/kuestcom/prediction-market@sha256:<digest>
3

Plan rollback before production traffic

Keep the previous healthy digest ready so you can redeploy it quickly if needed.
Rollback example:
flyctl deploy \
  --app <fly-app-name> \
  --config infra/fly/fly.toml \
  --image ghcr.io/kuestcom/prediction-market@sha256:<previous-digest>

Scheduler

Fly.io deployment does not replace the sync scheduler requirement. If you are not using Supabase mode, implement Scheduled Jobs with an external scheduler such as GitHub Actions or Cloud Scheduler.

Optional Terraform

cd infra/terraform/environments/production/fly
cp terraform.tfvars.example terraform.tfvars
terraform init
terraform plan
terraform apply