Skip to content

Instantly share code, notes, and snippets.

@RamyaIyer96
Created September 23, 2019 11:58
Show Gist options
  • Save RamyaIyer96/4cb1c6a598f624b410978d8948e72b39 to your computer and use it in GitHub Desktop.
Save RamyaIyer96/4cb1c6a598f624b410978d8948e72b39 to your computer and use it in GitHub Desktop.
Docker file to generate Reactjs build container and image.
FROM mhart/alpine-node:11 AS builder
WORKDIR /app
COPY . .
RUN yarn install
RUN yarn run build
FROM mhart/alpine-node
RUN yarn global add serve
WORKDIR /app
COPY --from=builder /app/build .
CMD ["serve", "-p", "3000", "-s", "."]
EXPOSE 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment