.nprmrc
file to your code repository with the contents that look something like //registry.npmjs.org/:_authToken=${NPM_TOKEN}
Do not actually fill in your token here! Use the variable which will be substituted later (this file is safe to check in to your code version system).Dockerfile
, preferably somewhere near the top (add a comment so you can remember why you put it there too!) The line looks like ARG NPM_TOKEN
npm install
command that you use. The line looks like COPY .npmrc .npmrc
['read:packages']
.npmrc
file to look similar to:${GITHUB_TOKEN}
(and remember to add secret: true
for the token)..yarnrc
file for the private repository. Please see this discussion for more details. Please let us know if this works or the documentation can be improved!