Merge pull request #228 from mrw34/patch-1

Add NODE_ENV ARG to onbuild template
This commit is contained in:
Christopher Horrell 2016-09-16 14:10:49 -04:00 committed by GitHub
commit 3502ce7b18
2 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,7 @@ FROM node:0.0.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ONBUILD ARG NODE_ENV
ONBUILD COPY package.json /usr/src/app/
ONBUILD RUN npm install
ONBUILD COPY . /usr/src/app

View File

@ -150,6 +150,10 @@ This `onbuild` variant will only install npm packages according to the
discussion in
[`nodejs/docker-node#65`](https://github.com/nodejs/docker-node/issues/65).
Note that npm installs devDependencies by default, which is undesirable if
you're building a production image. To avoid this pass NODE_ENV as a build
argument i.e. `docker build --build-arg NODE_ENV=production …`.
## `node:slim`
This image does not contain the common packages contained in the default tag and