migrating to config as code
ekohilas
PROOP

2 months ago

Hey Team,

We have a project with 4 services, and we're wanting to figure out how to migrate all settings related to the project and the ui to config as code so that we can automate changnes with claude instead of click ops.

I've used the cli to link a project locally, and git status reports as such, but I don't see a .railway or railway.toml

45 Replies

(no markdown available for this content)


IIRC there isn't a way to directly migrate all settings from the dashboard UI into toml/json.


ekohilas
PROOP

2 months ago

if I create a toml, will that overwrite all the settings in the UI?


The settings in the dashboard will not be updated with the settings defined in code. Configuration defined in code will always override values from the dashboard.


ekohilas
PROOP

2 months ago

right so if I wanted to migrate to config as code, I'd have to:

  • manually migrate the settings
  • override the settings in the ui to match (because they won't be updated)
  • tell devs not to touch the ui (because there's no way to lock it)

Basically, yes.


2 months ago

The UI will lock on certain settings once you have config files setup iirc


"Overriding" settings in the UI isn't necessary, but if you want them to match your json/toml configuration, then sure.


that sounds contradicting


That's what the docs say 🤷


cac takes priority

it also displays the cac value in the ui, and locks the ability to change it


2 months ago

Yes this is true. Been my experience


  1. if you open up a deployment on the dash, it shows the cac equivalent you can copy over
  2. see above
  3. yes to the "don't try to update in ui"

ekohilas
PROOP

2 months ago

so point 3 is invalid because they'll be locked

point 2 is invalid for the above, but the docs are outdated

point 1 is still valid


ekohilas
PROOP

2 months ago

thanks will take a look!


sleepy read it wrong, edited


It'll be something like this.

74801.png

Attachments


ekohilas
PROOP

2 months ago

Thank you I've found the config as code in the ui

Something that's not really clear is, how they should be setup for multiple services in the same repo?

e.g. they all say to save as railway.toml

do I just rename them based on the service?


If it's in a monorepo, you can put the config file in each "service's" root directory.


Eg, if I have /frontend and /backend from the same repository hosted on Railway, I'd save each services' config files in /frontend/railway.json and /backend/railway.json.


ekohilas
PROOP

2 months ago

what if I have 2 workers in the backend?


Don't think that would be possible, if they're hosted from the same directory.


ekohilas
PROOP

2 months ago

maybe I'm confused then


ekohilas
PROOP

2 months ago

this is what was meant earlier by the config that I could copy out?

image.png

Attachments


ekohilas
PROOP

2 months ago

but this config appears once, differently, for each service


ekohilas
PROOP

2 months ago

(I can't seem to find one single config file)


Yes.


Each service has its own configuration.


ekohilas
PROOP

2 months ago

here's another service


ekohilas
PROOP

2 months ago

image.png

Attachments



ekohilas
PROOP

2 months ago

sorry what's not possible?

I have multiple workers defined from the same directory so that doesn't seem like the issue


ekohilas
PROOP

2 months ago

do you mean having a single toml file for all services?


IIRC Railway does not support having multiple config files in a single directory if multiple services are hosted in that directory.


These "config files" are generated from the service itself. It ignores other services.


No.


I believe that it is possible to make multiple files and do it like "content.railway.toml", might not be detected properly but nothing should stop you from setting the path manually


How would you set the path?


in service settings of course

Screenshot_20260409-122516.png

Attachments


free form input with autocomplete


Nevermind I'm blind 💀


hi blind im astrid


@evan turns out you can do something like worker1.railway.toml and worker2.railway.toml as long as you specify the path to the config file as shown in Astrid’s image.

-# Sorry 😭


-# Sorry 😭


ekohilas
PROOP

2 months ago

all good we're all learning 😊


Welcome!

Sign in to your Railway account to join the conversation.

Loading...