Skip to content

Commit b6f51eb

Browse files
ddc22fhemberger
authored andcommitted
Changed command for building node modules to npm ci (#2080)
To maintain the exact tree as committed in development npm has introduced the npm ci command which is meant to provide reproducible builds. please take a look at the [official documentation|https://docs.npmjs.com/cli/ci.html] for more information. Co-Authored-By: jdc91 <[email protected]>
1 parent db34095 commit b6f51eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

locale/en/docs/guides/nodejs-docker-webapp.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,15 @@ COPY package*.json ./
110110
111111
RUN npm install
112112
# If you are building your code for production
113-
# RUN npm install --only=production
113+
# RUN npm ci --only=production
114114
```
115115

116116
Note that, rather than copying the entire working directory, we are only copying
117117
the `package.json` file. This allows us to take advantage of cached Docker
118118
layers. bitJudo has a good explanation of this
119-
[here](http://bitjudo.com/blog/2014/03/13/building-efficient-dockerfiles-node-dot-js/).
119+
[here](http://bitjudo.com/blog/2014/03/13/building-efficient-dockerfiles-node-dot-js/).
120+
Furthermore, the `npm ci` command, specified in the comments, helps provide faster, reliable, reproducible builds for production environments.
121+
You can read more about this [here](https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable).
120122

121123
To bundle your app's source code inside the Docker image, use the `COPY`
122124
instruction:
@@ -156,7 +158,7 @@ COPY package*.json ./
156158
157159
RUN npm install
158160
# If you are building your code for production
159-
# RUN npm install --only=production
161+
# RUN npm ci --only=production
160162
161163
# Bundle app source
162164
COPY . .

0 commit comments

Comments
 (0)