From 61ca70730088bb70dbdeff0cedf53f8eaf9e60ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20D=C3=B6rfler?= Date: Wed, 3 Jun 2020 08:03:09 +0200 Subject: [PATCH] updated build to intermediate docker build container --- .drone.yml | 6 ------ Dockerfile | 13 +++++++++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7f84499..99722af 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,12 +3,6 @@ type: docker name: Blog build and release steps: -- name: build - image: node:alpine - commands: - - npm install - - npx gatsby build - - name: docker image: plugins/docker settings: diff --git a/Dockerfile b/Dockerfile index 7cdae14..8e38477 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,13 @@ -FROM gatsbyjs/gatsby:onbuild as gatsby-build +FROM node:14.3 as build +WORKDIR /app + +COPY package.json ./ +RUN yarn install + +RUN yarn global add gatsby-cli + +COPY . ./ +RUN gatsby build FROM gatsbyjs/gatsby -COPY --from=gatsby-build /app/public /pub \ No newline at end of file +COPY --from=build /app/public /pub \ No newline at end of file