Merge pull request #228 from mrw34/patch-1
Add NODE_ENV ARG to onbuild template
This commit is contained in:
commit
3502ce7b18
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue