Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.