I've got a nodejs project that references a module I wrote and hosted by private github repo. Dependencies in package.json look something like this:
... other stuff ...
Theres a pretty easy solution to this. Build the node application
npm install etc
Then in your dockerfile include the
COPY command, telling it where the node projects install directory is, and where you want it to copy to.
To address the issue brought up by @angelok you should use npm rebuild once it's copied into the docker image so that it builds with the correct dependencies relative to the OS of the Docker image instead of the OS in which the node packages were initially installed. See docs for rebuild here.