Skip to content

Instantly share code, notes, and snippets.

@theCompanyDream
Last active May 5, 2020 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theCompanyDream/ca053e24208c5eb061025138c5f3c55a to your computer and use it in GitHub Desktop.
Save theCompanyDream/ca053e24208c5eb061025138c5f3c55a to your computer and use it in GitHub Desktop.
Gatsby Docker Mulitstage
FROM node:13.6.0-alpine as builder
ENV APP_ROOT /your/dir
WORKDIR ${APP_ROOT}
RUN apk update && apk add build-base \
autoconf \
automake \
libtool \
pkgconfig \
nasm \
python \
g++ \
&& rm -rf /var/cache/apk/*
COPY ./package.json .
COPY ./yarn.lock .
RUN yarn
# Our Libarary uses sharp and this image
FROM node:13.6.0-alpine
ENV APP_ROOT='/your/dir'
# Install Sharp
RUN apk add --update \
--repository http://dl-3.alpinelinux.org/alpine/edge/testing \
vips-tools \
&& rm -rf /var/cache/apk/*
RUN npm install -g gatsby
WORKDIR ${APP_ROOT}
# Also exposing VSCode debug ports
EXPOSE 8000 9929 9230
COPY --from=builder ${APP_ROOT} .
COPY . .
ENTRYPOINT [ "yarn", "develop"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment