From 0ec819e2323628129333ce295bccdad30379f155 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 4 May 2018 20:47:51 +0100 Subject: [PATCH] Cleanup container and reorder --- Dockerfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index e3b4cf5..d09914c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,5 @@ FROM node:8.10.0-alpine -RUN mkdir -p /public - -ENV NODE_ENV production - -RUN apk add --no-cache git - COPY ./src /app/src COPY ./package.json /app/package.json COPY ./package-lock.json /app/package-lock.json @@ -13,11 +7,18 @@ COPY ./tsconfig.json /app/tsconfig.json WORKDIR /app -RUN npm install --only=prod -RUN npm install --only=dev +RUN mkdir -p /public + +RUN apk add --no-cache git + +RUN npm install + +ENV NODE_ENV production RUN npm run build +RUN npm prune --production + CMD npm start -- /public EXPOSE 5000