Last active
January 18, 2021 15:39
-
-
Save lpsm-dev/08fc34236c66c1ac1243e1d5dfb1157f to your computer and use it in GitHub Desktop.
✨ Dockerfiles Multistaged
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
# 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