R
Railway

βœ‹ο½œhelp

Monorepo

Aacronie9/7/2023
If I am inside monorepo how will assigning domain work I wanna asign domain in two aspects
Bbrody1929/7/2023
lets say your monorepo has two services, this means you will need two railway services, and this also means each service will have its own domain
Aacronie9/7/2023
so change root directory?
Bbrody1929/7/2023
yes, you would need to set the root directory in each of the services settings
Aacronie9/7/2023
oh and variables too?
I have dotenv-cli setup for my root hmmm
what if it's a shared monorepo tho
Aacronie9/7/2023
but then what about port
my backend is on 8000 and frontend on 3000
Bbrody1929/7/2023
you still need two services
Aacronie9/7/2023
hmmm so technically how am I going to share stuff πŸ˜“
Bbrody1929/7/2023
the source is still the same repo
Aacronie9/7/2023
I don't understandd
πŸ˜…
Aacronie9/7/2023
Bbrody1929/7/2023
by chance have you read that docs section i linked?
Aacronie9/7/2023
yea
Aacronie9/7/2023
I have this command setup to run everything
Aacronie9/7/2023
for now since I have not yet laid the build script to build my monorepo
not my main motive rn
Bbrody1929/7/2023
you need two services, please reference the docs section i linked
Aacronie9/7/2023
ill check once again
Bbrody1929/7/2023
i assume this is a frontend and backend?
Aacronie9/7/2023
yea
The start command can be overridden in the Railway settings ( eg. npm run start:backend and npm run start:frontend).
but I only have one service right πŸ€”
Bbrody1929/7/2023
you need two services
Aacronie9/7/2023
that I get
but I don't get how will it be shared
Bbrody1929/7/2023
the source of the service is the same repo
Aacronie9/7/2023
so i remove deployments from this?
the "root"
Bbrody1929/7/2023
what
Aacronie9/7/2023
like the start commands
Aacronie9/7/2023
Aacronie9/7/2023
from deel I remove the commands to start?
Bbrody1929/7/2023
how many services in your repo do you have? just a frontend and backend?
Aacronie9/7/2023
yes.
Bbrody1929/7/2023
then you need 2 services, it looks like you have 3
one service for the frontend, and one service for the backend
Aacronie9/7/2023
and connect them both to the root of my monorepo but run only "one"
am I right?
Bbrody1929/7/2023
you would need to set the appropriate build and start commands for both services
Aacronie9/7/2023
Ohk
I will try thanks
Aacronie9/7/2023
why does it keep on killing itself
Aacronie9/7/2023
:sadcat:
Bbrody1929/7/2023
you're on the trial plan, and are likely trying to use more than 512mb of ram
Aacronie9/7/2023
oh hm
Bbrody1929/7/2023
upgrade time!!
Aacronie9/7/2023
yea
Bbrody1929/7/2023
πŸ₯³
Aacronie9/7/2023
I just did
Bbrody1929/7/2023
πŸ₯³ πŸ₯³
welcome to the club
Aacronie9/7/2023
haha
it still didn't work
idk wth is wrong
I am trying something else
Bbrody1929/7/2023
did you get the same killed?
Aacronie9/7/2023
Yea
Bbrody1929/7/2023
that's not ideal
Aacronie9/7/2023
Ohk i think it works now was a turbo repo issue ig
Bbrody1929/7/2023
hobby plan is where it's at anyway
Aacronie9/7/2023
yea thats not a problem needed the upgrade either ways
but
my url doesn't serve anything
the app seems to be running
Bbrody1929/7/2023
what status code do you get
Aacronie9/7/2023
404
Aacronie9/7/2023
Bbrody1929/7/2023
I still see dev, please do not run anything in development mode
Aacronie9/7/2023
yea its on purpose
Bbrody1929/7/2023
404 for every route?
Aacronie9/7/2023
yea
Aacronie9/7/2023
Aacronie9/7/2023
its compiling tho
so idk whats happening
Bbrody1929/7/2023
the next app should compile (build) in the build stage, and you shouldn't run dev on railway
Aacronie9/7/2023
mhm
okay I will try build
Bbrody1929/7/2023
next build and next start, that's all you should need, maybe some prisma stuff too
Aacronie9/7/2023
trying
Bbrody1929/7/2023
so what kind of backend is this?
if next is the frontend
Aacronie9/7/2023
it's not a backend it's just some services which I need
Bbrody1929/7/2023
welp you said yes to backend and frontend when I asked, so I can only go off what you said
Aacronie9/7/2023
Welp technically a backend over a backend
Hard to explain
:p
Okay build worked
Bbrody1929/7/2023
πŸ₯³
Aacronie9/7/2023
deel-web:start: Error: Cannot find module '.prisma/client/index'

deel-web:start: Require stack:
this after I setup my services
I don't know whats wrong πŸ€”
maybe because they're sharing same scope and it's overwriting in some way
Works perfectly fine locally. So I am not sure
Bbrody1929/7/2023
even though the two services share the same source they do not share the same filesystem
Aacronie9/7/2023
hmmm
Bbrody1929/7/2023
what version of node are you using locally?
Aacronie9/7/2023
20.6.0
Bbrody1929/7/2023
railway uses node 16 by default
Aacronie9/7/2023
idts that should be an issue here
Bbrody1929/7/2023
oh you'd be surprised
I'm not saying it is the issue, but it couldn't hurt to try
unfortunately railway only supports up to node 18 natively
but let's try that anyway, set engines.node to 18 in your package.json
Aacronie9/7/2023
lemme try if its working on node 18
locallu
Bbrody1929/7/2023
even if it does, railway is a docker environment, it's a whole other ball game if you never developed your app with a docker deployment in mind
Aacronie9/7/2023
The main issue is it's looking for prisma client and it's not able to find it
can test that
is their anyway to directly serve docker images then? that should be easier I could just publish images directly and have everything running but I am afraid that would need two services too?
Bbrody1929/7/2023
there is, but that would require you write a dockerfile
Aacronie9/7/2023
completely fine w that too
If it saves me from two services somehow?
Bbrody1929/7/2023
well if you know how to write a dockerfile, write the dockerfile and let railway build with the dockerfile
no need to publish an image
Aacronie9/7/2023
it will build the services itself?
or can I give it the whole monorepo and two ports two handle inside one service
Bbrody1929/7/2023
you give it a Dockerfile and it will build the service using that dockerfile
Aacronie9/7/2023
hmm
is their any example of dockerfile for monorepo on railway?
For the services and stuff and handling the whole monorepo and all
FROM node

ARG RAILWAY_ENVIRONMENT
ENV RAILWAY_ENVIRONMENT=$RAILWAY_ENVIRONMENT


COPY . ./app
RUN cd ./app
RUN npm install
RUN npm run build
CMD npm run start
will something bare minimum like this work out of the box
like for domains too
or do I need to write docker file for each.
Idk whats wrong sometimes it deploys just fine
and sometimes it doesn't want to
ik it doesn't make sense but that is what is happening
"build": "dotenv -e ../../.env prisma db push && dotenv -e ../../.env prisma generate && next build",
this is how my build script looks\ rn it says prisma client generated toodeel-web:start: Error: Cannot find module '.prisma/client/index'` but it's disappearing apparantely
it's strange sometimes it wants to work sometimes it doesn't
Lemme know if anyone has anything for me 😦
do these services run in different environment
or same
I get my one service running and other stops working gives me a feeling that theyre running in shared context
( hard to debug things as well )

Looking for more? Join the community!

R
Railway

βœ‹ο½œhelp

Join Server
Recommended Posts
I can not deploy angular project, killedI do not know what is the problem I hope someone can help me, Project ID dd70810d-29a4-4c5e-b7b4-f2NPM ssh dependancyHi I'm running into an issue where I'm using a private github npm dependancy and the build step is How to set mailgun to Ghost(docker) + SqliteI had used Ghost with mysql, but currently I try to use a new Ghost template with Sqlite. I did not Timeout while waiting for registry?All of my deploys have been building successfully but failing to deploy for the past ~hour or so. TContainer is failing to start.Everything was working fine, I just added a few new features to the app and now it is failing to depSeeing failures in deploying saying container shut down, but cannot find the container logs.Need help figuring out how to debug this issue with deploying to prod. From my end I don't think theHow to Delete Project?How do I delete a project I created so it doesn't show up in my homepage? Railway's documentation juInitial Deployment Continues To FailHello everyone. I am trying to setup, and stuck at the starting line. All ive done is connect githubDeployments sometimes takes timeMany times deployments take more than 5 minutes, although it should take less than 1 minute.Sveltekit memory usagemy sveltekit apps are almost locked to 100mb memory, anyone knows if theres like an option or somethOpen SourceHi, I am Richard, creator of ExpressoTS framework. Currently we are working in a section of our docuDifficulty with deploying a Flask + React appHi - I have a code architecture with a Flask backend (python) and a Node React frontend. The architeAny way to measure API Metrics for APIs deployed via Railwaythe no. of requests, the avg response timeMultiple accounts with same Github account?Can I somehow have multiple accounts but use code from the same Github account? I want to have a sepCan't create accountI try to signup using email but only get this error: "Device requesting login is not supported pleaRedis Data not showing up. Also not able set the key as well from redis-cliI am not able to access redis via the Console of railway as well not set any key via redis cliregion is only exclusive for pro plan?i'm planning to subscribe to hobby plan because it's more fit for me but my only concern is that i cServer is not builtUntil last night at 2am I sent a PR and the server was updated this morning, I hired a professional How to increase the disk size of a volume?Hey is there a option to increase the size of a volume we need 10gb? Thx for helpI cant pay my doubtIm trying to use Railway services again and found that i owe it a subcription so im trying to pay it