R
Railwayβ€’6mo ago
CoCa

Multiple Services in `railway.toml` ?

Is it possible to specify multiple services in a railway.toml file? For example if I want to setup a backend service and a frontend service, can I do that from one file or is it 100% scoped to just one service?
# backend service
[build]
builder = "nixpacks"
buildCommand = "go build -o output"

[deploy]
startCommand = "./output"
restartPolicyType = "never"

--

# frontend service
[build]
builder = "nixpacks"
buildCommand = "npm run build"

[deploy]
startCommand = "node ./build/index.js"
restartPolicyType = "never"
# backend service
[build]
builder = "nixpacks"
buildCommand = "go build -o output"

[deploy]
startCommand = "./output"
restartPolicyType = "never"

--

# frontend service
[build]
builder = "nixpacks"
buildCommand = "npm run build"

[deploy]
startCommand = "node ./build/index.js"
restartPolicyType = "never"
Solution:
templates can be unpublished, but they are never private, if you have secrets you want to deploy just leave them blank and fill them out when you go to deploy the template
Jump to solution
8 Replies
Percy
Percyβ€’6mo ago
Project ID: N/A
CoCa
CoCaβ€’6mo ago
Looking at the JSON Schema though it leads me to believe it's not possible
Brody
Brodyβ€’6mo ago
yeah scoped to a single service, what's your usecase?
CoCa
CoCaβ€’6mo ago
A Go backend + Svelte frontend mono repo, I can set it up manually still - I was just wondering if I can pre-setup the repo so once I link it to a Railway project it just kinda figures itself out πŸ™‚ At least this way I can automate whichever one is more time consuming to set up, and manually add the other but it'd be a neat feature if defining multiple services was allowed
Brody
Brodyβ€’6mo ago
maybe you want a template?
CoCa
CoCaβ€’6mo ago
Oh! ya I should totally look into that templates can be private, right? for secret stuff πŸ™‚
Solution
Brody
Brodyβ€’6mo ago
templates can be unpublished, but they are never private, if you have secrets you want to deploy just leave them blank and fill them out when you go to deploy the template
CoCa
CoCaβ€’6mo ago
I'll give templates a try today to see if works for me, thanks!