1

We have our private NPM Package that needs to be shared across microservices nodeJS apps on docker containers. We declared on our package.json of all the apps so the dependency is a path on the top of all the apps like this:

{
  "name": "myApp",
  "dependencies": {
    "CommonAndPrivatePackage": "file:../foo/bar"
  }
}

the problem is that the package "../foo/bar" is outside the dockerFile directory so i can not copy it to the container. even if i will find an option to copy it, the npm install command will not find the file because it will not be on the same path on the container. i do not want to change the package.json or have different package.json file for docker and for local usage.

if i could point to a private npm installation repository and host there the package it would be great so npm install will be able to grab the file from there like any other NPM published public packages.

I can not upload it to the public repository due to copyright issues.

Omtechguy
  • 3,321
  • 7
  • 37
  • 71
  • Does this answer your question? [Setting up docker nodejs application with local npm dependencies](https://stackoverflow.com/questions/44654215/setting-up-docker-nodejs-application-with-local-npm-dependencies) – Terite Sep 17 '20 at 15:52

0 Answers0