Last active
June 25, 2019 19:11
-
-
Save martindevnow/b1fa01f45bc60649396dc450acf2996b 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:9.11.1 as devBuild | |
## Set ENV Variables in the Image | |
ENV NODE_ENV=development | |
ENV PORT=8085 | |
ENV BABEL_DISABLE_CACHE=1 | |
## Prep node_modules | |
COPY package*.json /tmp/ | |
RUN cd /tmp && npm install | |
## Prep application | |
WORKDIR /usr/src/app | |
## Import Node Modules | |
RUN cp -a /tmp/node_modules /usr/src/app/ | |
## Run | |
EXPOSE 8085 | |
CMD [ "npm", "run", "serve" ] | |
FROM node:9.11.1 as ciBuild | |
WORKDIR /usr/src/app | |
COPY . /usr/src/app/ | |
COPY --from=devBuild /usr/src/app/node_modules ./node_modules | |
CMD [ "npm", "run", "serve" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment