Browse Source

improved caching in docker build

Bernadette Elena Hammerle 4 years ago
parent
commit
eb11372f36
1 changed files with 3 additions and 4 deletions
  1. 3 4
      Dockerfile

+ 3 - 4
Dockerfile

@@ -2,12 +2,11 @@ FROM node:12.13.0-alpine
 
 
 RUN apk add --no-cache git
 RUN apk add --no-cache git
 
 
-COPY . /app
+COPY package.json package-lock.json /app/
-
 WORKDIR /app
 WORKDIR /app
-
 RUN rm package-lock.json
 RUN rm package-lock.json
-
 RUN npm install
 RUN npm install
 
 
+COPY . /app
+
 CMD ["npm", "start"]
 CMD ["npm", "start"]