diff --git a/Dockerfile b/Dockerfile index 1484922..63a032f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/boot.sh b/boot.sh index 1796ab1..3b8bdbd 100644 --- a/boot.sh +++ b/boot.sh @@ -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" ];