Created
December 18, 2018 22:50
-
-
Save vschoener/6654fc17a694b90fa60eb5eeac4d52f5 to your computer and use it in GitHub Desktop.
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:11.4 as base | |
WORKDIR /app | |
# use changes to package.json to force Docker not to use the cache | |
# when we change our application's nodejs dependencies: | |
COPY package*.json /tmp/ | |
RUN cd /tmp && npm install --quiet | |
RUN cp -r /tmp/node_modules /app | |
# From here we load our application's code in, therefore the previous docker | |
# "layer" thats been cached will be used if possible | |
COPY . /app | |
CMD [ "npm", "start" ] | |
# If deployment / testing are used, we could also use other build stages | |
# We can also use a stage to add our tools if we don't want them in the devDepencies (cf apiDoc for ex.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment