How do I deploy a shared monorepo?
rc85
HOBBYOP

18 days ago

I'm not using anything like turborepo, workspaces, pnpm, etc.

My project structure looks like this

/_shared
/client
/server
  /dist
  /src
  package.json

_shared are common files like types and utils that both client and server uses. I'm not concern about deploy client because I'm using vercel for that. I'm trying to deploy server, but if I set the root to server, it cannot access files in _shared. If I don't set a root, I think I was getting an error that it doesn't know how to build my app. If I put into the build command something like cd server && npm i && npm run build, I get npm: command not found. If I leave the build command blank, it says it doesn't know how to build my app. The only way it will build is if I set root directory to server.

So what do I have to do to deploy server?

$10 Bounty

1 Replies

Status changed to Open Railway 18 days ago


I'd recommend using a Dockerfile to individually copy the shared folder and the client/server folder into the container for both services (client & service).


Welcome!

Sign in to your Railway account to join the conversation.

Loading...