Skip to content

Instantly share code, notes, and snippets.

@debabrata100
Created August 28, 2018 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debabrata100/cedaa7cc9f9b47bbce79705e4fbd3d6a to your computer and use it in GitHub Desktop.
Save debabrata100/cedaa7cc9f9b47bbce79705e4fbd3d6a to your computer and use it in GitHub Desktop.
Dockerfile for create-react-app
# 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