Created
March 27, 2015 02:20
-
-
Save learncodeacademy/ef9a4c2c69e4ae0c32f8 to your computer and use it in GitHub Desktop.
Node Dockerfile
This file contains 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:0.12.0 | |
# 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 && mkdir data && npm install --production --unsafe-perm | |
RUN mkdir -p /app && cp -a /tmp/node_modules /app/ && cp -a /tmp/data /app/ | |
# From here we load our application's code in, therefore the previous docker | |
# "layer" thats been cached will be used if possible | |
WORKDIR /app | |
ADD . /app | |
EXPOSE 3000 | |
ENV NODE_ENV production | |
CMD ["npm", "start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment