My folder structure looks like this (monorepo):
project
|
+--- /api
| |
| +--- /.offline-cache
| +--- /src
| | +--- index.js
| | +--- ...
| |
| +--- Dockerfile
| +--- package.json
| +--- yarn.lock
|
+--- /common
| |
| +--- /src
| | +--- index.js
| |
| +--- package.json
|
+--- /ui
| |
| +--- /.offline-cache
| +--- /src
| | +--- index.js
| | +--- ...
| |
| +--- Dockerfile
| +--- package.json
| +--- yarn.lock
|
+--- docker-compose.yml
The offline-cache and building the docker-images for every 'service' (ui, api) are working.
Now I want to access/install the common module inside api and ui as well.
Running yarn add ./../common inside /api works and installs the module inside the api folder and adds it to package.json and yarn.lock file.
But when I try to rebuild the docker-image I get an error telling me
error Package "" refers to a non-existing file '"/common"'.
that's because there is no common folder inside the docker container and the installed package isn't added to the offline-mirror :(
I can't copy the common folder to the docker-image because it is outside the build context and I don't want to publish to NPM. What else can I do to get this working?