Browse Source

npm install before adding the rest of files in dockerfile

Michael Strickland 7 years ago
parent
commit
f5cdc8c3ca
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Dockerfile

+ 3 - 1
Dockerfile View File

8
 COPY package.json /usr/src/app/
8
 COPY package.json /usr/src/app/
9
 RUN apt-get update -y && apt-get upgrade -y && \
9
 RUN apt-get update -y && apt-get upgrade -y && \
10
     apt-get install -y nodejs npm libcairo2-dev libjpeg62-turbo-dev libpango1.0-dev libgif-dev libpng-dev build-essential g++ ffmpeg
10
     apt-get install -y nodejs npm libcairo2-dev libjpeg62-turbo-dev libpango1.0-dev libgif-dev libpng-dev build-essential g++ ffmpeg
11
-COPY ./ /usr/src/app/
11
+COPY package.json* yarn.lock* .npmrc* /usr/src/app/
12
 RUN npm install --production
12
 RUN npm install --production
13
 
13
 
14
+COPY ./ /usr/src/app/
15
+
14
 EXPOSE 8888
16
 EXPOSE 8888
15
 CMD [ "npm", "start" ]
17
 CMD [ "npm", "start" ]