Notes on two frequent corner cases: Angular not surporting / and project-specific .npmrc (#46)

* Update docker-and-private-modules.mdx * Update docker-and-private-modules.mdx

Alexander Mikhailian committed Nov 3, 2021 at 17:13 UTC bd7337a965a9e5ecb8e77ae0943248cc4d782ee8
1 file changed +7 -3
content/integrations/integrating-npm-with-external-services/docker-and-private-modules.mdx
+7 -3
@@ -11,7 +11,7 @@ To install private npm packages in a Docker container, you will need to use Dock
11 You cannot install private npm packages in a Docker container using only runtime variables. Consider the following Dockerfile:
12
13 ```
14 -FROM risingstack/alpine:3.3-v4.3.1-3.0.1
14 +FROM node
15
16 COPY package.json package.json
17 RUN npm install
@@ -21,7 +21,7 @@ COPY . .
21 CMD npm start
22 ```
23
24 -Which will use the RisingStack [Alpine Node.JS Docker image](https://hub.docker.com/r/risingstack/alpine/), copy the `package.json` into our container, installs dependencies, copies the source files and runs the start command as specified in the `package.json`.
24 +Which will use the official [Node.js](https://hub.docker.com/_/node) image, copy the `package.json` into our container, installs dependencies, copies the source files and runs the start command as specified in the `package.json`.
25
26 In order to install private packages, you may think that we could just add a line before we run `npm install`, using the [ENV parameter](https://docs.docker.com/engine/reference/builder/#env):
27
@@ -54,7 +54,7 @@ Use a project-specific `.npmrc` file with a variable for your token to securely
54 The Dockerfile that takes advantage of this has a few more lines in it than the earlier example that allows us to use the `.npmrc` file and the `ARG` parameter:
55
56 ```
57 -FROM risingstack/alpine:3.3-v4.3.1-3.0.1
57 +FROM node
58
59 ARG NPM_TOKEN
60 COPY .npmrc .npmrc
@@ -83,4 +83,8 @@ This will build the Docker image with the current `NPM_TOKEN` environment variab
83
84 **Note:** Even if you delete the `.npmrc` file, it will be kept in the commit history. To clean your secrets entirely, make sure to squash them.
85
86 +**Note:** You may commit the `.npmrc` file under a different name, e.g. `.npmrc.docker` to prevent local build from using it.
87 +
88 +**Note:** You may need to specify a working directory different from the default `/` otherwise some frameworks like Angular will fail.
89 +
90 </Note>