Skip to content

Instantly share code, notes, and snippets.

@MassivDash
Created January 4, 2020 21:17
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 MassivDash/98fec3dd9a473166c57019040d728a37 to your computer and use it in GitHub Desktop.
Save MassivDash/98fec3dd9a473166c57019040d728a37 to your computer and use it in GitHub Desktop.
Gatsby V1 Docker Config, Node 10, phyton, image sharp, development
version: '3'
services:
node:
build:
context: .
args:
APP_DIR: ${APP_DIR}build
environment:
- NODE_ENV=development
container_name: gatsby-development
tty: true
stdin_open: true
volumes:
- ./:${APP_DIR}:cached
- ${APP_DIR}/build
- ${APP_DIR}/node_modules
- ${APP_DIR}/public
- ${APP_DIR}/data
- ${APP_DIR}/.cache
- ${APP_DIR}/static
working_dir: ${APP_DIR}
user: node
command: >
sh -c '
npm install && yarn build
'
ports:
- 3000:3000
- 8000:8000
version: '3'
services:
node:
build:
context: .
args:
APP_DIR: ${APP_DIR}
environment:
- NODE_ENV=development
container_name: gatsby-development
tty: true
stdin_open: true
volumes:
- ./:${APP_DIR}:cached
- ${APP_DIR}/build
- ${APP_DIR}/node_modules
- ${APP_DIR}/public
- ${APP_DIR}/data
- ${APP_DIR}/.cache
- ${APP_DIR}/static
working_dir: ${APP_DIR}
user: node
command: >
sh -c '
npm install && yarn develop
'
ports:
- 3000:3000
- 8000:8000
FROM node:10.15.3-alpine
RUN apk add --no-cache tini git
RUN apk add --no-cache --virtual \
python \
make \
g++ \
RUN apk update && apk add --upgrade --no-cache build-base autoconf automake libtool pkgconfig nasm
RUN apk add --upgrade --no-cache vips-dev build-base \
--repository https://alpine.global.ssl.fastly.net/alpine/v3.10/community/
ARG APP_DIR
RUN mkdir -p ${APP_DIR}/build && \
mkdir -p ${APP_DIR}/data && \
mkdir -p ${APP_DIR}/.cache && \
mkdir -p ${APP_DIR}/public && \
mkdir -p ${APP_DIR}/static && \
mkdir -p ${APP_DIR}/src && \
mkdir -p ${APP_DIR}/node_modules && \
mkdir -p /home/node/.cache/yarn && \
chown node:node -R ${APP_DIR} /home/node
USER node
ENTRYPOINT ["/sbin/tini", "--"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment