#Multiple railway.json files in a monorepo

28 messages · Page 1 of 1 (latest)

rose oak
#

Hey guys I'm looking to deploy a worker separate from the application which will be two services on railway. I was attempting to do this by specifying the name of the second railway config file such as railway-workers.json within the settings tab as shown in the attached image but I kept getting an error back config file railway-workers.json does not exist Is this because you cannot rename the file? if so what's the best approach here? To keep railway.json and put in another directory?

abstract deltaBOT
#

Project ID: N/A

reef heathBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

rose oak
#

N/A

spare patio
#

what specific inputs have you tried?

rose oak
#

railway-workers.json which is the file that exists within the repo

spare patio
#

where does it exist in the repo?

rose oak
#

root

#

alongside the working and existing railway.json (as there are two config files, one for the application and one for the workers)

spare patio
#

when you set a root directory in the service settings, only that specific folder is copied into the container, so if you wanted to use the railway-workers.json file it would need to be in the same root directory as you've set in the settings

rose oak
#

yes correct, it exists there

#

again, it exists the alongside working railway.json

#

it's just a copy and paste with a minor change in the start command in place

spare patio
#

you said your workers railway.json exists in the root of the repo?

rose oak
#

to be more specific no inside of the monorepo it exists within packages/backend and the railway.json works correctly

#

all I'm doing is copying and pasting the railway.json in place and renaming it to railway-workers.json so that it can call an alternative start command. This filename is given at the settings page on railway and fails to be found.

spare patio
#

are you able to share your repo?

rose oak
#

hmm I can do this on the main litestar one

#

not immediately though, in the meantime to accelerate testing and maybe obviate the need for that, is it known if one needs to use railway.json as the name or can the file be different?

#

Additionally, previously when inputting a different name in the settings page it was redeploying but now it no longer seems to, what's the way to trigger the redeploy with the config settings inside of the settings page, and not use the default railway.json?

spare patio
#

try specifying the full path to your desired railway json

rose oak
#

thank you will try that, also thanks for bookmarklet

spare patio
#

this is a monorepo right?

rose oak
#

prior to you asking to provide full path, I had moved it to a folder and used full path and that worked

#

so I'm going to rename it back to railway-workers.json and see if that works, if it does then yes full path is required. Might be good to have that on the settings page as the implication is right above it you set the relative repo path....it is not intuitive for a user to have to put the full path again.

spare patio
#

alright let me know how it goes

rose oak
#

This worked thanks Brody! tldr full path is needed regardless of whether it's the same name of railway.json or railway-workers.json. please maybe tell railway team to note that on the frontend UI