feat: add Railway deployment target#117
Merged
Merged
Conversation
Add --railway to setup-project.sh alongside --cloudflare, --node, and --lambda. Railway deploys the same multi-stage Docker image as the Node.js target, so the runtime code is shared: the railway platform reuses the node snippets and node-server Dockerfile/compose, adding Railway config-as-code on top. - templates/railway/: railway.toml (Dockerfile build, /health check, start command, restart policy) and nixpacks.toml (pnpm + Node 22 pins for the non-Docker build) - setup-project.sh: --railway flag, .env.example with Railway reference-variable notes (DATABASE_URL via Postgres reference), README deployment instructions (dashboard setup, root directory, service variables, auto-deploy, migrations via railway run) - No deploy workflow generated: Railway auto-deploys the connected GitHub repo, gated by the /health check - CI: require templates/railway; no new snippets to type-check - deployment-config-generator (Step 2d) and schema-intake skills, pipeline.config.json, and docs updated for the fourth target 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.
Summary
Adds Railway as Nerva's fourth deployment target. Railway builds the service from the same hardened multi-stage Dockerfile as the Node.js target — so the runtime code is fully shared — and
railway.toml(config-as-code) wires up the build,/healthhealth check gating each deploy, start command, and restart policy. Managed PostgreSQL connects via Railway's reference variables.Closes #31
Changes
setup-project.sh --railway— reuses thenodesnippets andnode-serverDockerfile/compose (Railway is a Node deployment), addsrailway.toml+nixpacks.toml, writes an.env.exampledocumenting Railway's${{Postgres.DATABASE_URL}}reference-variable syntax, and generates README deployment instructions (project + PostgreSQL setup, Root Directory =api, service variables table, auto-deploy behavior,railway run pnpm db:migratefor migrations, Nixpacks alternative)templates/railway/railway.toml—builder = "DOCKERFILE",healthcheckPath = "/health"(failing checks keep the previous deploy live),startCommand,ON_FAILURErestart policy, watch patterns; commentedpreDeployCommandwith the dev-deps caveatnixpacks.toml— pnpm + Node 22 toolchain pins and build/start commands, used when switchingbuilder = "NIXPACKS"templates/railwayadded to the required-dirs check; no new snippets, so no new typecheck stepdeployment-config-generatorStep 2d (Railway config-as-code, env reference table, Root Directory reminder),schema-intaketarget union + interview option,pipeline.config.jsonrailwayblock, target mentions across CLAUDE.md/README/onboarding/pipeline docs,railwaynpm keywordTest plan
bash -n+ shellcheck (CI severity) onsetup-project.sh; JSON validation of touched configs--railwayproject: 20/20 Vitest tests pass;railway.toml,nixpacks.toml,Dockerfile,docker-compose.ymlpresent; README contains the deployment instructions with literal${{Postgres.DATABASE_URL}}references--nodedry-run contains zero Railway files and a real node run earlier this session passes tests;--lambdadry-run unchanged🤖 Generated with Claude Code