Last active
May 5, 2020 14:14
-
-
Save theCompanyDream/ca053e24208c5eb061025138c5f3c55a to your computer and use it in GitHub Desktop.
Gatsby Docker Mulitstage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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