Include monorepo root in build environment

saphewilliam
HOBBY

a year ago

Hey! I ran into an issue today deploying a service in my typescript turborepo monorepository.

The service is using a Dockerfile to build the container, but also depends on a private package in the monorepo. If I set the root directory to the service directory, it can't find the package in the monorepo. If I set the root directory to the monorepo root, it can't find the dockerfile in the service directory.

I know Vercel has an option to set a root directory, but include the monorepo root in the build to account for these issues. How should I deal with this on Railway?

Solved

4 Replies

saphewilliam
HOBBY

a year ago

The option in Vercel I'm referring to:

Attachments


10 months ago

Hello,

For a shared monorepo you would not want to set a root directory so make sure you are using filtered build and start commands.

As for telling Railway where your Dockerfile is located, use a RAILWAY_DOCKERFILE_PATH variable - https://docs.railway.app/reference/variables#user-provided-configuration-variables


saphewilliam
HOBBY

10 months ago

Hey Brody,

Thats exactly what I needed! Thanks a lot


10 months ago

No problem!


Status changed to Solved brody 11 months ago


Include monorepo root in build environment - Railway Help Station