How do I deploy a shared monorepo?
rc85
HOBBYOP

a month 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?

Solved$10 Bounty

Pinned Solution

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).

1 Replies

Status changed to Open Railway about 1 month 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).


Status changed to Solved 0x5b62656e5d 10 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...