R
Railway16mo ago
sharki

creating more than 1 domain under service

i have a service that runs 2 processes at once, that means i need 2 domains under 1 service, but after adding one i dont see an option to add another
39 Replies
Percy
Percy16mo ago
Project ID: e0c71b52-cf71-4d16-b94c-bce42e3db870
sharki
sharki16mo ago
e0c71b52-cf71-4d16-b94c-bce42e3db870
Brody
Brody16mo ago
sharki
sharki16mo ago
i can create multiple custom domains?
Brody
Brody16mo ago
of course
sharki
sharki16mo ago
thank you, didnt know how do i got about linking them to a port
Brody
Brody16mo ago
you can only expose a single port
sharki
sharki16mo ago
so if i have my client on 3000 and my api on 8080 what would i do
Brody
Brody16mo ago
run them as separate railway services
sharki
sharki16mo ago
the dockerfile provided runs both the client and api at once, if i only serve one port then its running a whole server thats not being used, making me pay more
Brody
Brody16mo ago
can you send the dockerfile?
sharki
sharki16mo ago
would you like me to send the github repo?
Brody
Brody16mo ago
that would be even better
sharki
sharki16mo ago
GitHub
GitHub - SnailyCAD/snaily-cadv4: 💻 An open source Computer Aided Di...
💻 An open source Computer Aided Dispatch (CAD) for FiveM, this is a web based integration for communities who love police roleplaying and dispatching. Discord: https://discord.gg/eGnrPqEH7U - GitHu...
Brody
Brody16mo ago
have two railway services and set one services root directory to /apps/api and the other to /apps/client
sharki
sharki16mo ago
me and the repo owner have been struggling to find a way for this to work, mostly because it depends on docker compose
Adam
Adam16mo ago
This sounds to me like they should be in separate services in the same project
sharki
sharki16mo ago
i tried earlier
Adam
Adam16mo ago
whoops more messages
Adam
Adam16mo ago
yeah I agree with brody
sharki
sharki16mo ago
and Dockerfile:8 ------------------- 7 | 8 | >>> RUN yarn config set httpTimeout 1200000 && \ 9 | >>> npx turbo prune --scope=@snailycad/api --docker && \ 10 | >>> yarn install 11 | ------------------- ERROR: failed to solve: process "/bin/sh -c yarn config set httpTimeout 1200000 && npx turbo prune --scope=@snailycad/api --docker && yarn install" did not complete successfully: exit code: 1
Brody
Brody16mo ago
okay then leave the root directory at / for both services and just set the correct start commands in the service settings
sharki
sharki16mo ago
ive tried that before but forget what went wrong, trying now hopefully i can get this working, ive been wanting to make the switch for a while. i have instances of that repo running on a vps that im paying $20+ for and i have to manage updates and random crashes, hopefully if this works i can make a full itme switch
Brody
Brody16mo ago
on the vps have you mapped each service to a different domain
sharki
sharki16mo ago
on a different sub domain theiugh nginx the issue was it cant access the packages under /packages Error: Cannot find module '/app/node_modules/@snailycad/utils/dist/version.js' at createEsmNotFoundErr (node:internal/modules/cjs/loader:1016:15) at finalizeEsmResolution (node:internal/modules/cjs/loader:1009:15) at resolveExports (node:internal/modules/cjs/loader:529:14) at Function.Module._findPath (node:internal/modules/cjs/loader:569:31) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue (/app/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30) at Function.Module._resolveFilename (/app/node_modules/tsconfig-paths/src/register.ts:115:36) at Function.Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) { code: 'MODULE_NOT_FOUND', path: '/app/node_modules/@snailycad/utils/package.json' }
Brody
Brody16mo ago
i recommended fixing that issue before proceeding you will want to have two separate services for this
sharki
sharki16mo ago
this is an issue caused on railway
Brody
Brody16mo ago
no its not
sharki
sharki16mo ago
?
Brody
Brody16mo ago
this would happen on any similar host your repo is structured incorrectly or setup wrong
sharki
sharki16mo ago
it's not mine, but whats wrong with it
Brody
Brody16mo ago
i dont know im not a js dev but ive been using railway for long enough to know that this isnt a platform issue
sharki
sharki16mo ago
will i ever be able to expose more than one port on a service
Brody
Brody16mo ago
i think its a planned feature, but you really don't need to, you should be running two railway services
sharki
sharki16mo ago
when ran on a vps its supposed to be ran in one service under 2 domains, shouldnt it be like that on railway aswell
Brody
Brody16mo ago
you can run two services and add your desired domain to each trust me, that is absolutely the way to go on railway, you can't think of services as vps'es
sharki
sharki16mo ago
i tried to do that way and the error above keeps coming up, it isnt working like i said im not too sure what it is i guess ill get in contact with the repo owner
Brody
Brody16mo ago
yeah you would need to make changes to the repo
Want results from more Discord servers?
Add your server