a year ago
Good morning,
I've an API inside a monorepo structure, using yarn workspace, that currently is taking more than 20 minutes to build.
The API is a Nest.js project (standard) and it is inside the monorepo application.
Config on railway:
Builder: Nixpacks
Providers: Node
Custom build: yarn build:api
Watch Paths: /packages/bestbarbers-api/**
Custom start command: yarn start:api:prod
Runtime: Legacy
Resource: 32 vCPU and 32gb memory.
Is there any way to optimize this build?
1 Replies
a year ago
Hello,
Looks like the yarn install
step is what is taking the longest with a duration of 718.5 seconds.
This is likely installing all dependences for all packages in your monorepo, perhaps you can look into writing a custom Dockerfile for the API that will only install the dependencies for the API app.
You can put that Dockerfile in the applicable location and tell Railway to use it with a RAILWAY_DOCKERFILE_PATH
service variable - https://docs.railway.app/guides/dockerfiles#custom-dockerfile-path
Status changed to Awaiting User Response Railway • about 1 year ago
2 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 2 months ago