Created
April 20, 2021 23:26
-
-
Save eduardomp/e606531ca1587d1feab2649085939d21 to your computer and use it in GitHub Desktop.
Dockerfile for React applications
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:15-alpine AS build | |
WORKDIR /app | |
ENV PATH /app/node_modules/.bin:$PATH | |
RUN apk add --no-cache --virtual yarn | |
COPY . /app | |
RUN yarn install --silent && \ | |
yarn global add react-scripts@4.0.1 --silent && \ | |
yarn run build | |
# serve the app | |
FROM nginx:stable-alpine | |
COPY --from=build /app/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