Skip to content

Instantly share code, notes, and snippets.

@aofleejay
Created June 28, 2019 10:44
Show Gist options
  • Save aofleejay/8a6bef8470f2b08c90fa4c56cf60f5c7 to your computer and use it in GitHub Desktop.
Save aofleejay/8a6bef8470f2b08c90fa4c56cf60f5c7 to your computer and use it in GitHub Desktop.
Dockerfile for deploy React application from create-react-app using Docker multi-stage builds.
FROM node:12.4.0-alpine as build
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn
COPY src ./src
COPY public ./public
RUN yarn build
FROM nginx:1.17.0-alpine
COPY --from=build /usr/src/app/build /usr/share/nginx/html
EXPOSE 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment