How do I run multiple commandbox servers from the ...
# box-products
d
How do I run multiple commandbox servers from the same codebase(essentially the same box.json). The only way I can do it is to change the name in box.json to be unique.
On the same VM - i hope the diagram is useful.
s
you might be able to specify the start arguments and ignore using the server.json config
d
ooof, lots of env vars play a role in server.json
s
you meant server.json in your original question correct, or did you mean box.json?
d
I meant box.json
s
no you can have 1 box.json
d
right
s
the server.json is what needs to be unique
d
it is because name is an env var.
s
so you could have a branchfeature3-server.json
d
huh
s
commandbox will let you start 2 servers on the same codebase so long as the ‘server’ name is unique
d
so technically I do have two unique server names because I"m using an env variable for the name in server.json.
Update: I was able to start the second server and the name is the correct value which is from the env variable. But
server info
I think is looking at the name in box.json and so gives me the info of the first server.
s
ah, ok cool
d
and bullet-train is also probably looking at box.json and giving me the name of the first server.
s
yeah, im sure its just calling the server info
d
Thanks Scott. the other idea of using a unique server.json ie: branch3-server.json is not bad.
s
yes, i should mention i got the order wrong in the name it should be
server-{name}.json
d
ok thanks. I'll try it.
@Scott Steinbeck deleting the name property in box.json does the trick.
as long as appname in server.json is unique - which can be solved with an env variable.