feat: add Fly.io deployment target#118
Merged
Merged
Conversation
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>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
--flyflag insetup-project.sh— copies the node-serverDockerfile/docker-compose.yml(the issue's "can reuse the Node.js Dockerfile", same single-source-of-truth approach the merged Railway PR used) plustemplates/fly/fly.toml, writes a Fly-specific.env.example, and warns if flyctl is missingtemplates/fly/fly.tomlwith everything the issue asks for:fly launch --no-deployadopts the file and writes the unique name back)internal_port = 3000withforce_https/healthcheck ([[http_service.checks]]) gating every deploymin_machines_running = 1+ autostop/autostart; Fly has no max key in fly.toml — the ceiling is the Machine count, documented asfly scale count 3fly mpg create/fly mpg attach(sets theDATABASE_URLsecret automatically; Managed Postgres is Fly's supported offering — unmanaged Fly Postgres is now explicitly unsupported upstream)deployment-config-generatorskill — new Step 2e with the fly.toml template, secrets/Postgres commands, scaling notes, and a commentedflyctl deploy --remote-onlyCI snippet;schema-intaketarget union and interview options updated toofly mpg proxy, since the production image prunes drizzle-kit — same caveat as Railway'spreDeployCommand)pipeline.config.json—flyadded todeployment.targetsplus aflysettings blocktemplates/flyadded to the required-directories check; no new snippets to type-checkVerification
bash -nand ShellCheck (--severity=warning, matching CI) pass onsetup-project.shpipeline.config.jsonandfly.tomlparse cleanly./scripts/setup-project.sh fly-e2e --flygenerates a working project — Dockerfile, fly.toml, .env.example, and README section all present; test suite passes 20/20Note: pre-existing typecheck regression (all targets, not this PR)
While e2e-testing,
pnpm typecheckin the generated project fails withCannot find name 'process'. This is not Fly-specific:pnpm add -D typescriptnow installs TypeScript 6, which no longer auto-includesnode_modules/@types, and the copiedtemplates/shared/tsconfig.jsonhas no"types"field (CI's snippet check passes becausetemplates/snippets/tsconfig.node.jsonsets"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