Skip to content

Commit aa53b15

Browse files
authored
Add NODE_ENV ARG to onbuild template
It's currently impossible to prevent npm installing devDependencies when using the node onbuild images. Adding a NODE_ENV ARG enables `docker build --build-arg NODE_ENV=production .`, which is the equivalent of `npm install --production`. Providing the `--build-arg` is optional, so this is backwards-compatible.
1 parent 2ba1b9c commit aa53b15

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Dockerfile-onbuild.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM node:0.0.0
22

3+
ARG NODE_ENV
4+
35
RUN mkdir -p /usr/src/app
46
WORKDIR /usr/src/app
57

0 commit comments

Comments
 (0)