Created
February 9, 2015 18:40
-
-
Save parshap/aae5d6fcdae84a25d402 to your computer and use it in GitHub Desktop.
Caching npm install with Docker
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 nodesource/node:trusty | |
EXPOSE 8080 | |
WORKDIR /src | |
# Install dependencies | |
# See http://www.clock.co.uk/blog/a-guide-on-how-to-cache-npm-install-with-docker | |
ADD package.json /src/package.json | |
RUN npm install | |
ADD . /src | |
# Run npm install again in case a package.json change was not picked up by | |
# Docker. | |
RUN npm install | |
CMD [ "npm", "start" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment