Skip to content

chore: move Railway service config to Config as Code - #46

Merged
CountableNewt merged 2 commits into
devfrom
chore/railway-config-as-code
Sep 28, 2026
Merged

CountableNewt merged 2 commits into
devfrom
chore/railway-config-as-code

Conversation

@CountableNewt

Copy link
Copy Markdown
Collaborator

Railway stops reading railway.json-style config files on 2026-12-01. This moves the Gateway and Web settings from railway/gateway.json and railway/web.json into .railway/railway.ts.

What's in .railway/railway.ts

  • Source: GitHub dev in Development and main in Production (via ctx.isEnvironment), Wait for CI on, root directory /.
  • Build and deploy settings carried over exactly from the JSON files: Gateway uses the Dockerfile with /health and a 600s healthcheck timeout; Web uses Railpack with Turbo, bun --cwd apps/web start and /.
  • Postgres, its volume, and every service variable (as preserve()). railway config apply deletes anything undeclared: the first draft planned to delete the dev database and 29 variables. Values stay in Railway and never enter source.
  • Domains are not managed, so the Gateway's runtime-provisioned tenant domains (e.g. mcp.samclemente.me) are safe.
  • Adds the railway SDK (3.11.0) as a root dev dependency, which the CLI needs to evaluate the file.

Current plans (read-only)

Environment Plan
dev 0 add, 4 change, 0 destroy: build and deploy fields only (currently supplied by the JSON files)
production 0 add, 5 change, 0 destroy: the same, plus Gateway rootDirectory /services/mcp-gateway → /

⚠️ Merge order (draft until done)

The services still point their "Railway Config File" setting at /railway/*.json, which this PR deletes.

  1. railway link --project 3647f696-1766-459a-ac3f-0482e5a1f26c --environment dev && railway config plan && railway config apply
  2. Repeat for --environment production, checking the plan still shows 0 to destroy.
  3. In each environment, clear the Config File path for Gateway and Web (Service → Settings).
  4. Mark ready and merge. The resulting dev build is the first build fully driven by .railway/railway.ts.

Other changes

  • Drop the jq config check from scripts/ci.sh; update the (currently unused) path filters in scripts/ci-detect-changes.sh, railway/README.md and the test-plans doc.

🤖 Generated with Claude Code

CountableNewt and others added 2 commits September 27, 2026 17:45
Railway stops reading railway.json-style config files on 2026-12-01.
Define Gateway and Web source/build/deploy settings (plus the Postgres
database, its volume, and preserve() entries for every service variable,
since apply deletes anything undeclared) in .railway/railway.ts, with the
branch chosen per environment. Remove railway/gateway.json and
railway/web.json and their CI check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s-code

# Conflicts:
#	docs/test-plans/README.md
@CountableNewt
CountableNewt marked this pull request as ready for review September 27, 2026 23:24
@CountableNewt
CountableNewt merged commit 2b354a1 into dev Sep 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant