File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM node:0.0.0
33RUN mkdir -p /usr/src/app
44WORKDIR /usr/src/app
55
6+ ONBUILD ARG NODE_ENV
67ONBUILD COPY package.json /usr/src/app/
78ONBUILD RUN npm install
89ONBUILD COPY . /usr/src/app
Original file line number Diff line number Diff line change @@ -150,6 +150,10 @@ This `onbuild` variant will only install npm packages according to the
150150discussion in
151151[ ` nodejs/docker-node#65 ` ] ( https://github.com/nodejs/docker-node/issues/65 ) .
152152
153+ Note that npm installs devDependencies by default, which is undesirable if
154+ you're building a production image. To avoid this pass NODE_ENV as a build
155+ argument i.e. ` docker build --build-arg NODE_ENV=production … ` .
156+
153157## ` node:slim `
154158
155159This image does not contain the common packages contained in the default tag and
You can’t perform that action at this time.
0 commit comments