Last active
February 10, 2021 08:52
-
-
Save waldemarnt/50f75e06e632f54f73aa9507fd7ebca5 to your computer and use it in GitHub Desktop.
Dockerfile to build a Node.js app
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:4.3.2 | |
RUN useradd --user-group --create-home --shell /bin/false app &&\ | |
npm install --global [email protected] | |
ENV HOME=/home/app | |
COPY package.json npm-shrinkwrap.json $HOME/library/ | |
RUN chown -R app:app $HOME/* | |
USER app | |
WORKDIR $HOME/library | |
RUN npm cache clean && npm install --silent --progress=false | |
USER root | |
COPY . $HOME/library | |
RUN chown -R app:app $HOME/* | |
USER app | |
CMD ["npm", "start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment