Sign inSign up

futureys/gatsby

By futureys

•Updated about 1 month ago

Gatsby development environment.

Image
Buildkit cache
0

3.3K

Dockerfile
# Since oficial image is only for testing hosting built static files
# see: https://github.com/gatsbyjs/gatsby-docker/issues/25#issuecomment-626197455
# see: https://www.stoutlabs.com/blog/2019-02-05-my-docker-setup-gatsby-next/
# And following official image is legacy
# see: https://hub.docker.com/r/gatsbyjs/gatsby-dev-builds
FROM node:alpine

RUN apk add --no-cache \
# git: gatsby new command depends on git
    git \
# util-linux: gatsby develop calls lscpu
# openssl, sudo: gatsby develop --https uses
    util-linux openssl sudo \
# node-sess version 4 uses g++ and still requires python2
# see: https://github.com/sass/node-sass/issues/2877
    python g++ \
# gatsby-plugin-sharp depends on imagemin-mozjpeg,
# imagemin-mozjpeg depends on mozjpeg,
# mozjpeg requires compiling from source with autoreconf, automake, libtool, gcc, make, musl-dev, file, pkgconfig, nasm
# see: https://pkgs.alpinelinux.org/contents?page=1&file=autoreconf
# see: https://github.com/buffer/pylibemu/issues/24#issuecomment-492759639
# see: https://github.com/maxmind/libmaxminddb/issues/9#issuecomment-30836272
# see: https://stackoverflow.com/questions/28631817/no-acceptable-c-compiler-found-in-path/57419374#57419374
# see: https://pkgs.alpinelinux.org/contents?branch=v3.3&name=file&arch=x86&repo=main
# see: https://stackoverflow.com/questions/17089858/pkg-config-pkg-prog-pkg-config-command-not-found/17106579#17106579
# see: https://github.com/alicevision/AliceVision/issues/593#issuecomment-457194176
    autoconf automake libtool gcc make musl-dev file pkgconfig nasm \
# sharp depends on vips
# see: https://github.com/lovell/sharp/issues/773
    vips \
 && rm -fR /var/cache/apk/*

# Also exposing VSCode debug ports
# 8000      : For HTTP access for development
# 9000      : For HTTP access for audit
# see: https://www.gatsbyjs.com/tutorial/part-eight/
EXPOSE 8000 9000

# We introduce yarn since it's still faster and isn't found any defintive defects.
# In Gatsby development, gatsby-cli is required.
# When install gatsby-cli in global, we can omit it in package.json.
RUN yarn global add gatsby-cli && yarn cache clean

WORKDIR /workspace
CMD ["gatsby", "develop", "-H", "0.0.0.0" ]