Skip to content

Instantly share code, notes, and snippets.

@mateeyow
Created May 24, 2017 06:06
Show Gist options
  • Save mateeyow/ca4607a0d2b3f270ef6e1a202c02bca6 to your computer and use it in GitHub Desktop.
Save mateeyow/ca4607a0d2b3f270ef6e1a202c02bca6 to your computer and use it in GitHub Desktop.
Dockerizing node with minimal docker image size and with gyp dependency
version: '3'
services:
web:
image: image_name
ports:
- '6060:3033'
container_name: container_name
restart: always
FROM node:6-alpine
RUN apk update
RUN apk add --no-cache --virtual .gyp \
python \
make \
g++
COPY package.json /tmp/package.json
RUN cd /tmp && yarn
RUN apk del .gyp
RUN mkdir -p /usr/app && cp -a /tmp/node_modules /usr/app
WORKDIR /usr/app
COPY ./ /usr/app
#EXPOSE 3033
#CMD yarn start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment