Skip to content

Instantly share code, notes, and snippets.

@TheMagoo73
Created August 19, 2019 13:39
Show Gist options
  • Save TheMagoo73/0c22e8978cafcc450b86d085032859b6 to your computer and use it in GitHub Desktop.
Save TheMagoo73/0c22e8978cafcc450b86d085032859b6 to your computer and use it in GitHub Desktop.
Example dockerfile for React and NGINX
FROM node:11.1.0-alpine as build
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY ./ /app/
RUN npm run build
FROM nginx:1.15.8-alpine
COPY --from=build /app/build /usr/share/nginx/html
COPY --from=build /app/nginx/nginx.conf /etc/nginx/nginx.conf
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