Skip to content

Instantly share code, notes, and snippets.

@stoutlabs
Last active October 15, 2020 21:41
Show Gist options
  • Save stoutlabs/a067b0bf713d8d38510a1d854b8d9c24 to your computer and use it in GitHub Desktop.
Save stoutlabs/a067b0bf713d8d38510a1d854b8d9c24 to your computer and use it in GitHub Desktop.
Simple Dockerfile for GatsbyJS (and NextJS)
version: '3'
services:
gatsby:
build:
context: .
dockerfile: Dockerfile
# args:
# - NODE_ENV=development
# command: nodemon --inspect=0.0.0.0:9229 ./bin/www
ports:
- "8000:8000"
- "9229:9229"
- "9230:9230"
volumes:
- /app/node_modules
- .:/app
environment:
- NODE_ENV=development
- GATSBY_WEBPACK_PUBLICPATH=/
FROM node:alpine
EXPOSE 8000 9929 9230
RUN \
apk add --no-cache python make g++ && \
apk add vips-dev fftw-dev --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing --repository http://dl-3.alpinelinux.org/alpine/edge/main && \
rm -fR /var/cache/apk/*
RUN npm install -g gatsby-cli yarn
WORKDIR /app
COPY ./package.json ./
RUN yarn install && yarn cache clean
COPY . .
CMD ["gatsby", "develop", "-H", "0.0.0.0" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment