Appearance
Moving from Railway
Follow the six steps; this page covers what's specific to Railway.
Draft the config
Railway's config file describes one service, so run init from that service's directory:
bash
keel init --from railway.json # or railway.tomlWhat Keel reads from it:
- The start command,
healthcheckPathandnumReplicasbecome awebservice. preDeployCommandbecomesrelease.command. A list of commands runs in order, as one command.cronSchedulemakes the service a scheduled task instead, with the schedule converted. Railway uses five-field Unix cron and AWS uses a six-field form with days of the week numbered from Sunday = 1. The draft shows the converted expression.- A Dockerfile path is kept. If the file asks for Nixpacks or Railpack, Keel builds with a Dockerfile when the repository has one, and with Cloud Native Buildpacks when it doesn't;
initprints which. - A Procfile beside it adds the other process types as worker services.
Some things are reported rather than translated:
- The port. Railway assigns
PORTwhen the app starts, and its file never names one. The draft writes8080as a placeholder; change it to the port the app listens on. sleepApplication. An ECS service doesn't sleep when traffic stops.environmentsoverrides. Declare those underenvironments:inkeel.yml.buildCommand. Put it in the Dockerfile.
Variables and the database
Railway keeps variables and databases in its dashboard, not in railway.json, so the draft has neither. Add them yourself:
List the service's variable names in the Railway dashboard or with
railway variables. Add each one undersecrets:inkeel.yml, then set its value:bashkeel config set STRIPE_KEY=...Leave out the ones Railway generates from a database reference (
DATABASE_URLand similar). Keel provides the database's own credentials, asDATABASE_HOST,DATABASE_USER,DATABASE_PASSWORDand the rest.Declare the database:
yamldatabase: engine: postgres version: "16"After
keel up, take a dump through the database's public connection URL from the Railway dashboard, and load it:bashpg_dump -Fc --no-owner --no-acl "$RAILWAY_DATABASE_PUBLIC_URL" > app.dump keel db import app.dump
Several services
A Railway project with an API, a worker and a cron job has a config file per service. Run keel init --from on the main one, then copy the others' commands into services: in the same keel.yml. One Keel app is one project.