I am trying to use Rush to handle a monorepo. I saw a recent, similar question at How to build for docker (rush monorepo)?, but it has no answers and is more about build issues than development issues.
Rush uses symlinks to avoid copying the same dependencies across different packages in same repo.
I am using docker-compose
for local dev as I would for any other project. The config is like this:
version: '3'
services:
web:
build: .
image: 'my-image'
command: "npm start"
user: "node"
working_dir: /home/node/app
volumes:
- ./:/home/node/app
When I do docker-compose up
it can’t find any of my dependencies. If I copy the folder to a random location, run npm install
, and try the same it works because there are no symlinks.
I was debating doing a volume to the source location of ../../common/temp/node_modules/
but that that might be a bit crazy as it has every node modules for all the packages. The thing is that the files live outside of the folder structure of my server/docker package.
Is there some docker or rush optionality I am missing?
2
Answers
This works, but feels wrong. Hoping another user has a better answer.
I would guess that you have
node_modules
in your .dockerignore path, so it is not including the output of your install run from your host. When you do the volume, the empty folder then gets mapped over.