From 088336dd2a3b816c9a19ec45b89663a9852e5665 Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Mon, 26 Nov 2018 10:08:48 +0100 Subject: [PATCH] try to improve build process and remove styleguide node modules after build --- Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8399f0c34..7ababd203 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,19 +11,19 @@ WORKDIR $WORKDIR # See: https://github.com/nodejs/docker-node/pull/367#issuecomment-430807898 RUN apk --no-cache add git -# Install Styleguide -COPY styleguide/ ./styleguide -RUN cd styleguide && yarn install --production=false --frozen-lockfile --non-interactive --ignore-engines - +# Install Web Application COPY package.json . COPY yarn.lock . - -# Build Styleguide -RUN yarn run styleguide:build - -# Install Web Application +COPY styleguide/ ./styleguide RUN yarn install --production=false --frozen-lockfile --non-interactive --ignore-engines +# Install and build Styleguide +COPY styleguide/ ./styleguide +RUN cd styleguide && yarn install --production=false --frozen-lockfile --non-interactive --ignore-engines \ + && cd .. \ + && yarn run styleguide:build \ + && rm -Rf styleguide/node_modules + COPY . . RUN ["yarn", "run", "build"] CMD ["yarn", "run", "start"]