Skip to content

story: Deploy pre-alpha/alpha to Fly.io (non-K8s) #91

@GitAddRemote

Description

@GitAddRemote

User Story

As a platform maintainer,
I want to deploy the app to Fly.io for pre-alpha/alpha testing without Kubernetes,
So that we can ship quickly while supporting ~50–100 users with low–medium concurrency.

Context

Production will use Kubernetes + Helm, but early testing should use a simpler deployment platform. Fly.io should host both backend and frontend with minimal ops overhead.

Definition of Done

  • Fly.io apps are created for backend and frontend, with documented setup steps.
  • Backend deploys with required environment variables, health checks, and a managed Postgres database.
  • Frontend deploys as a static site or lightweight web server with correct API base URL.
  • CI/CD can deploy to Fly.io on demand (manual or branch-based) with secrets stored in GitHub.
  • Basic observability is configured (logs + metrics/health endpoints).
  • A runbook exists for rollback and basic scaling adjustments.

Technical Elaboration

  • Create Fly apps:
    • station-backend-prealpha (NestJS)
    • station-frontend-prealpha (React)
  • Add fly.toml files for each app with:
    • Region selection and VM sizing for low–medium concurrency.
    • Health checks (HTTP or TCP) and restart policies.
    • Environment variables and secret management.
  • Backend:
    • Provision Fly Postgres (single node) and attach to backend app.
    • Configure DATABASE_*, JWT_SECRET, REDIS_* (optional), PORT, NODE_ENV.
    • Ensure migrations run during deploy or via release command.
  • Frontend:
    • Use static hosting or lightweight web server (e.g., nginx).
    • Set VITE_API_BASE_URL to backend Fly hostname.
  • CI/CD:
    • Add GitHub Actions workflow (manual trigger) that builds and deploys both apps via flyctl.
    • Store FLY_API_TOKEN in GitHub secrets.
  • Scaling:
    • Start with 1–2 small VMs per app; document how to scale memory/CPU or add replicas.
    • Validate expected load for 50–100 users with low–medium concurrency.

Notes

  • This is an early-stage deployment; no k8s/helm required.
  • Production k8s pipeline remains unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions