Skip to content

Instantly share code, notes, and snippets.

@bbachi
Created July 29, 2019 03:10
Show Gist options
  • Save bbachi/1c4b728546d2c1e7eb2206e03a234484 to your computer and use it in GitHub Desktop.
Save bbachi/1c4b728546d2c1e7eb2206e03a234484 to your computer and use it in GitHub Desktop.
docker multi build example
FROM node:10 AS ui-build
WORKDIR /usr/src/app
COPY WebApp/ ./WebApp/
RUN cd WebApp && npm install @angular/cli && npm install && npm run build
FROM node:10 AS server-build
WORKDIR /root/
COPY --from=ui-build /usr/src/app/WebApp/dist ./WebApp/dist
COPY package*.json ./
RUN npm install
COPY index.js .
EXPOSE 3070
ENTRYPOINT ["node"]
CMD ["index.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment