Skip to content

Instantly share code, notes, and snippets.

@lpsm-dev
Last active January 18, 2021 15:39
Show Gist options
  • Save lpsm-dev/08fc34236c66c1ac1243e1d5dfb1157f to your computer and use it in GitHub Desktop.
Save lpsm-dev/08fc34236c66c1ac1243e1d5dfb1157f to your computer and use it in GitHub Desktop.
✨ Dockerfiles Multistaged
# Stage 1 - the build process
FROM node:10-alpine as build-deps
WORKDIR /src
COPY package.json package-lock.json ./
RUN npm i --silent
COPY . ./
RUN npm run build
# Stage 2 - the production environment
FROM nginx:1.12-alpine
COPY --from=build-deps /src/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment