forked from gatsbyjs/gatsby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (20 loc) · 962 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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 [email protected]
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
WORKDIR /usr/src/app
# To run this image, set the port as an env var with `-e PORT=xxxx` e.g.
# docker run -p 8080:8080 --rm -it -e PORT=8080 <registryUsername>/<imageName>
CMD [ "node","./scripts/www-data-explorer.js" ]