Skip to content

feat: add Fly.io deployment target#118

Merged
PAMulligan merged 1 commit into
mainfrom
30-add-flyio-deployment-target
Jun 13, 2026
Merged

feat: add Fly.io deployment target#118
PAMulligan merged 1 commit into
mainfrom
30-add-flyio-deployment-target

Conversation

@PAMulligan

Copy link
Copy Markdown
Contributor

Closes #30

Summary

Adds Fly.io as the fifth deployment target, following the exact pattern of the Railway target (#117): Fly.io builds the same hardened multi-stage Docker image as the Node.js target, so the runtime code is fully shared and templates/fly/ adds only the platform config on top.

Acceptance criteria

  • --fly flag in setup-project.sh — copies the node-server Dockerfile/docker-compose.yml (the issue's "can reuse the Node.js Dockerfile", same single-source-of-truth approach the merged Railway PR used) plus templates/fly/fly.toml, writes a Fly-specific .env.example, and warns if flyctl is missing
  • templates/fly/fly.toml with everything the issue asks for:
    • app name placeholder (fly launch --no-deploy adopts the file and writes the unique name back)
    • HTTP service on internal_port = 3000 with force_https
    • /health check ([[http_service.checks]]) gating every deploy
    • auto-scaling min 1 / max 3: min_machines_running = 1 + autostop/autostart; Fly has no max key in fly.toml — the ceiling is the Machine count, documented as fly scale count 3
    • PostgreSQL attachment reference: fly mpg create / fly mpg attach (sets the DATABASE_URL secret automatically; Managed Postgres is Fly's supported offering — unmanaged Fly Postgres is now explicitly unsupported upstream)
  • deployment-config-generator skill — new Step 2e with the fly.toml template, secrets/Postgres commands, scaling notes, and a commented flyctl deploy --remote-only CI snippet; schema-intake target union and interview options updated too
  • Generated project README — one-time setup, deploys, scaling, and migrations (via fly mpg proxy, since the production image prunes drizzle-kit — same caveat as Railway's preDeployCommand)
  • pipeline.config.jsonfly added to deployment.targets plus a fly settings block
  • CItemplates/fly added to the required-directories check; no new snippets to type-check

Verification

  • All fly.toml keys checked against the live fly.toml reference; every linked Fly.io docs URL curl-tested (all 200)
  • bash -n and ShellCheck (--severity=warning, matching CI) pass on setup-project.sh
  • pipeline.config.json and fly.toml parse cleanly
  • End-to-end: ./scripts/setup-project.sh fly-e2e --fly generates a working project — Dockerfile, fly.toml, .env.example, and README section all present; test suite passes 20/20

Note: pre-existing typecheck regression (all targets, not this PR)

While e2e-testing, pnpm typecheck in the generated project fails with Cannot find name 'process'. This is not Fly-specific: pnpm add -D typescript now installs TypeScript 6, which no longer auto-includes node_modules/@types, and the copied templates/shared/tsconfig.json has no "types" field (CI's snippet check passes because templates/snippets/tsconfig.node.json sets "types": ["node"] explicitly). Every target generated today (--node, --railway, --lambda, --fly) hits this. The fix needs per-target tsconfig handling (Cloudflare wants workers types, not node), so it's left for a separate issue.

🤖 Generated with Claude Code

Add --fly to setup-project.sh alongside --cloudflare, --node, --lambda,
and --railway. Fly.io deploys the same multi-stage Docker image as the
Node.js target, so the runtime code is shared: the fly platform reuses
the node snippets and node-server Dockerfile/compose, adding fly.toml
on top.

- templates/fly/fly.toml: app name placeholder, HTTP service on
  internal_port 3000 with force_https, /health check gating each
  deploy, autostop/autostart scaling (min_machines_running = 1, ceiling
  set with `fly scale count 3` for min 1 / max 3), Managed Postgres
  attachment reference (fly mpg attach sets DATABASE_URL), commented
  release_command with the pruned-dev-deps caveat
- setup-project.sh: --fly flag, .env.example with flyctl secrets notes,
  README deployment instructions (fly launch, mpg create/attach,
  secrets, deploys, scaling, migrations via fly mpg proxy)
- No deploy workflow generated: `fly deploy` is the primary flow;
  continuous deployment via GitHub Actions + FLY_API_TOKEN is linked
- CI: require templates/fly; no new snippets to type-check
- deployment-config-generator (Step 2e) and schema-intake skills,
  pipeline.config.json, and docs updated for the fifth target

All fly.toml keys verified against the live fly.toml reference; all
linked Fly.io doc URLs return 200. End-to-end: setup-project.sh
my-api --fly generates a project whose test suite passes (20/20).

Closes #30

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PAMulligan PAMulligan linked an issue Jun 12, 2026 that may be closed by this pull request
7 tasks
@github-actions github-actions Bot added area: agents Claude Code agents area: skills Claude Code skills area: scripts Automation scripts area: templates Starter templates area: pipeline Build pipeline area: ci-cd CI/CD workflows area: docs Documentation labels Jun 12, 2026
@PAMulligan PAMulligan self-assigned this Jun 13, 2026
@PAMulligan PAMulligan moved this from Todo to Done in PMDS Open Source Roadmap Jun 13, 2026
@PAMulligan PAMulligan merged commit ab3b3c5 into main Jun 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agents Claude Code agents area: ci-cd CI/CD workflows area: docs Documentation area: pipeline Build pipeline area: scripts Automation scripts area: skills Claude Code skills area: templates Starter templates

Projects

Development

Successfully merging this pull request may close these issues.

Add Fly.io deployment target

1 participant