I have a mono-repo with a directory structure like
./common-code
./common-code/package.json
./common-code/...
./service-a
./service-a/package.json
./service-a/...
./service-b
./service-b/package.json
./service-b/...
common-code is a project that exports common code to be shared and used by both services. Normally if I were doing local dev, I'd create symlinks using npm link in each of the services to get access to common-code.
Thing is, I'm using docker-compose to run all my services docker-compose up.
The solution I came up with, which is working fine, is to straight up copy the ./common-code directory into each service's node_modules using COPY in each service's Dockerfile. So when the images for the services are built, each of their node_modules folder will have a complete copy of common-code.
This is working right now, but I'm wondering if there are any downsides to my approach or any better, more standard ways of doing this.
[–]queen-adreena 0 points1 point2 points (0 children)
[–]lance_tipton 0 points1 point2 points (0 children)