From 54f617b5ad47e77435f8242100e6cb567558d5aa Mon Sep 17 00:00:00 2001 From: tympom <34450106+tympom@users.noreply.github.com> Date: Wed, 24 Jun 2020 12:09:00 +0200 Subject: [PATCH] Multistage build for smaller image --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 441dda3..4505da9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,11 @@ -FROM node:12.18.1-alpine +FROM node:12.18.1-alpine as build RUN apk --no-cache add git python3 make g++ WORKDIR /app COPY . . RUN npm install --no-optional + +FROM node:12.18.1-alpine as app +WORKDIR /app +COPY --from=build /app /app EXPOSE 10407 CMD ["npm", "start"]