Skip to content

Instantly share code, notes, and snippets.

@Tmeister
Created June 19, 2015 17:50
Show Gist options
  • Save Tmeister/42ed9a8d08ad9fed9e21 to your computer and use it in GitHub Desktop.
Save Tmeister/42ed9a8d08ad9fed9e21 to your computer and use it in GitHub Desktop.
FROM dockerfile/nodejs
MAINTAINER Enrique Chavez <[email protected]>
# use changes to package.json to force Docker not to use the cache
# when we change our application's nodejs dependencies:
ADD package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /opt/app && cp -a /tmp/node_modules /opt/app/
# From here we load our application's code in, therefore the previous docker
# "layer" thats been cached will be used if possible
WORKDIR /opt/app
ADD . /opt/app
EXPOSE 8080
CMD ["npm", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment