From 154ea4d249218e953e479775dac1b3e7a502dd02 Mon Sep 17 00:00:00 2001 From: Mike Allanson Date: Mon, 5 Mar 2018 23:30:46 +0000 Subject: [PATCH] Skip libvips and builds tools as sharp v0.20.0 now downloads binaries (#4378) --- Dockerfile | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 73fe5644a6143..5aecf1ba0b10c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,11 @@ # Create a standalone instance of GraphiQL populated with gatsbyjs.org's data # --- -# libvips needed for image manipulation -FROM marcbachmann/libvips:8.4.1 as build - -# Node.js version 8 and build tools for sharp -RUN apt-get update && apt-get install -y build-essential g++ curl -RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* - -RUN npm install -g yarn@1.3.2 +# TODO: Can we do this all on Alpine for a smaller image? +FROM node:8 WORKDIR /usr/src/app - COPY . . -RUN yarn && cd www && yarn -RUN cd www && yarn run build - -# Start again and just copy across the built files (+ node_modules) -# TODO: Can we do this all on Alpine for a much smaller image? This node:8 image is ~600MB -FROM node:8 as dist - -COPY --from=build /usr/src/app /usr/src/app +RUN yarn && cd www && yarn && yarn run build # Set cwd to www so that Gatsby's bootstrap can find www/gatsby-node.js WORKDIR /usr/src/app/www