瀏覽代碼

improved caching in docker build

Bernadette Elena Hammerle 4 年之前
父節點
當前提交
eb11372f36
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      Dockerfile

+ 3 - 4
Dockerfile

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