Last active
April 21, 2023 04:00
-
-
Save YokiToki/c50f07dcb19c5963aa96ec19646dce21 to your computer and use it in GitHub Desktop.
Multi-stage react build
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
FROM node:16-alpine AS builder | |
WORKDIR /app | |
COPY package.json yarn.lock ./ | |
RUN yarn | |
COPY . ./ | |
RUN yarn build | |
FROM nginx:1.23.4-alpine | |
WORKDIR /usr/share/nginx/html | |
RUN rm -rf ./* | |
COPY --from=builder /app/build . | |
EXPOSE 80 | |
ENTRYPOINT ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment