Skip to content

Commit 3c13d34

Browse files
committed
Only install dependencies if package.json is present
1 parent 53bf40c commit 3c13d34

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ RUN npm install
1515
CMD sh boot.sh
1616

1717
ONBUILD ADD . /app/
18-
ONBUILD RUN cd /usr/src/app && npm install && npm install /app
18+
ONBUILD RUN cd /usr/src/app && npm install && if [ -f "/app/package.json" ]; then npm install /app; fi

boot.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#! /bin/sh
2-
32
## Install new dependencies
4-
npm install /app
3+
if [ -f "/app/package.json" ];
4+
then
5+
npm install /app
6+
fi
57
npm install
68

79
if [ "$NODE_ENV" == "production" ];

0 commit comments

Comments
 (0)