Skip to content

Commit

Permalink
Only install dependencies if package.json is present
Browse files Browse the repository at this point in the history
  • Loading branch information
erikap committed May 30, 2017
1 parent 53bf40c commit 3c13d34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ RUN npm install
CMD sh boot.sh

ONBUILD ADD . /app/
ONBUILD RUN cd /usr/src/app && npm install && npm install /app
ONBUILD RUN cd /usr/src/app && npm install && if [ -f "/app/package.json" ]; then npm install /app; fi
6 changes: 4 additions & 2 deletions boot.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#! /bin/sh

## Install new dependencies
npm install /app
if [ -f "/app/package.json" ];
then
npm install /app
fi
npm install

if [ "$NODE_ENV" == "production" ];
Expand Down

0 comments on commit 3c13d34

Please sign in to comment.