From 4e6fc3eb63e6a740bf9fc7b374e54cf20f9b03e8 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Mon, 16 Mar 2020 12:49:38 +0100 Subject: [PATCH] docker multistage && image version --- Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7525413..4f8e817 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,20 @@ -FROM node:alpine +# Stage 1 testing +FROM node:13.10.1-alpine COPY package.json /data/ COPY src /data/src COPY public /data/public -RUN cd /data && npm i +RUN cd /data && npm i && npm test + +# Stage 2 package +FROM node:13.10.1-alpine + +COPY package.json /data/ +COPY src /data/src +COPY public /data/public + +RUN cd /data && npm i --only=production WORKDIR /data