DEV Community

Discussion on: Monorepo and Microservice setup in Nest.js

Collapse
 
oaksoe profile image
Oak Soe Kyaw

Nice Article!

I have Nest microservices in different repos. Planning to use monorepo, but one thing struck my mind which is, each app under src don't have package.json, unlike lerna + yarn workspace.

Then, how will docker work? Let's say microserviceA has dependencies 1,2,3 and microserviceB has dep 4,5. With this setup, microserviceA container will have all the dependencies inside and same for B.

Collapse
 
oaksoe profile image
Oak Soe Kyaw

I think will need to use lerna or yarn workspace.

According to this: github.com/nestjs/nest-cli/issues/533

'The philosophy behind Nest CLI monorepo is different (it assumes that all shared libraries will exist in one repository, won't be published to any registry, and will be bundled together with the app).'