From 07d87bdb0490d887e0df9015ffc426cd00cf56f7 Mon Sep 17 00:00:00 2001 From: Oleg Kurapov Date: Sun, 11 Nov 2018 13:15:22 +0100 Subject: [PATCH] Use multistage Dockerfile to cut down image size (#140) --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e92eb7..6c7228b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,15 @@ +FROM node:8-alpine as builder +WORKDIR /usr/src/app +RUN apk add --update build-base python +COPY . /usr/src/app +RUN yarn + FROM node:8-alpine MAINTAINER butlerx@notthe.cloud WORKDIR /app RUN adduser -D -h /home/term -s /bin/sh term && \ ( echo "term:term" | chpasswd ) && \ - apk add --update build-base python openssh-client + apk add openssh-client EXPOSE 3000 -COPY . /app -RUN yarn +COPY --from=builder /usr/src/app /app CMD node bin