Skip to content

Instantly share code, notes, and snippets.

@ujwaldhakal
Last active May 3, 2021 15:26
Show Gist options
  • Save ujwaldhakal/3b8cc027d02343e9a7a41ac59d824284 to your computer and use it in GitHub Desktop.
Save ujwaldhakal/3b8cc027d02343e9a7a41ac59d824284 to your computer and use it in GitHub Desktop.
Dockerfile
# Build Stage 1
# This build created a staging docker image
#
FROM node:10.15.2-alpine AS appbuild
WORKDIR /usr/src/app
COPY package.json ./
RUN npm install
COPY ./src ./src
# Build Stage 2
# This build takes the production build from staging build
#
FROM node:10.15.2-alpine as production
WORKDIR /usr/src/app
COPY package.json ./
RUN npm install
COPY --from=appbuild /usr/src/app/ ./
EXPOSE 4002
CMD npm run production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment