Created
August 28, 2018 18:53
-
-
Save debabrata100/cedaa7cc9f9b47bbce79705e4fbd3d6a to your computer and use it in GitHub Desktop.
Dockerfile for create-react-app
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 | |
FROM node:8 as react-build | |
WORKDIR /app | |
COPY . ./ | |
RUN yarn | |
RUN yarn build | |
# Stage 2 - the production environment | |
FROM nginx:alpine | |
COPY nginx.conf /etc/nginx/conf.d/default.conf | |
COPY --from=react-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