Skip to content

Commit 8b27598

Browse files
MaledongZYSzys
authored andcommitted
zh-CN:Trans for 'nodejs-docker-webapp.md' (#2083)
Ref:#2080.
1 parent b6f51eb commit 8b27598

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

locale/zh-cn/docs/guides/nodejs-docker-webapp.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ COPY package*.json ./
9090
9191
RUN npm install
9292
# If you are building your code for production
93-
# RUN npm install --only=production
93+
# RUN npm ci --only=production
9494
```
9595

9696
请注意,我们只是拷贝了 `package.json` 文件而非整个工作目录。这允许我们利用缓存 Docker 层的优势。bitJudo 对此有一个很好的解释,请 [见此](http://bitjudo.com/blog/2014/03/13/building-efficient-dockerfiles-node-dot-js/)
97+
进一步说,对于生产环境而言,注释中提及的 `npm ci` 命令协助提供了一个更快、可靠、可再生的构建环境。欲知详情,可以参考[此处](https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable)
9798

9899
在 Docker 镜像中使用 `COPY` 命令绑定你的应用程序:
99100

@@ -129,7 +130,7 @@ COPY package*.json ./
129130
130131
RUN npm install
131132
# If you are building your code for production
132-
# RUN npm install --only=production
133+
# RUN npm ci --only=production
133134
134135
# Bundle app source
135136
COPY . .

0 commit comments

Comments
 (0)