1

I have the case that I can not use npm install in my Dockerfile for all of my packages because some of them are private and using the technique described here on npm using an auth token is not working in this scenario.

So I'm now following these instructions https://stackoverflow.com/a/38782109/9931013

But as it would be way faster and more convenient to just copy the private npm packages instead of all I was wondering if anyone had an idea on how to do this.

p.s. Of course I could just add all node_modules subfolders except for the private ones to .dockerignore I guess but as Joey from Friends once said: "There's got to be a better way!!"

4
  • 1
    Can you be a bit more specific about why you can't use the private modules with npm install? Copying some files from node_modules on the host doesn't seem like a good option. Commented Aug 9, 2018 at 7:27
  • Thanks for your comment! +1 ;) for security problems described by some tutorials, that the aforementioned way does leave the npm auth token open for others to see in the histroy. But the way described by van_Skyr worked actually so I just should have checked the .gitignore posts as well instead of just .dockerignore. Anyhow thanks! Commented Aug 9, 2018 at 8:08
  • @juanlumn yeah I agree but I'd like to keep it for people like me not thinking of searching for the same case in .gitignore questions at first if thats ok Commented Aug 9, 2018 at 8:11
  • nevermind it stays open regardless so I've marked it as duplicate Commented Aug 9, 2018 at 8:29

0

Browse other questions tagged or ask your own question.