Created
May 24, 2017 06:06
-
-
Save mateeyow/ca4607a0d2b3f270ef6e1a202c02bca6 to your computer and use it in GitHub Desktop.
Dockerizing node with minimal docker image size and with gyp dependency
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
version: '3' | |
services: | |
web: | |
image: image_name | |
ports: | |
- '6060:3033' | |
container_name: container_name | |
restart: always |
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: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