Last active
June 10, 2017 18:07
-
-
Save ishan-marikar/9893bd4846d8f784f47eac1866d9c4f0 to your computer and use it in GitHub Desktop.
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:alpine | |
# http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html | |
RUN useradd --user-group --create-home --shell /bin/false deploy | |
ENV HOME=/home/deploy | |
USER deploy | |
RUN npm install pm2 -g | |
RUN npm install yarn -g | |
VOLUME ["/home/deploy/app"] | |
WORKDIR /home/deploy/app | |
COPY package.json /tmp/package.json | |
RUN cd /tmp && yarn | |
RUN yarn cache clean | |
RUN mkdir -p /home/deploy/app && cp -a /tmp/node_modules/ /home/deploy/app | |
COPY . /home/deploy/app | |
RUN chown -R deploy:deploy $HOME/* | |
CMD ["node", "index.js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment