Skip to content

Instantly share code, notes, and snippets.

@imyjimmy
Created May 15, 2019 15:58
Show Gist options
  • Save imyjimmy/0f9bf312a58e6568df5a6b8cb905fd28 to your computer and use it in GitHub Desktop.
Save imyjimmy/0f9bf312a58e6568df5a6b8cb905fd28 to your computer and use it in GitHub Desktop.
example Dockerfiles for React App
FROM node:8
WORKDIR /app
COPY . ./
RUN yarn
RUN yarn run build
RUN yarn global add serve
CMD ["serve", "-p", "3000", "-s", "/app/build"]
### Another Possibility
FROM mhart/alpine-node:11 AS builder
WORKDIR /app
COPY . .
RUN yarn run build
FROM mhart/alpine-node
RUN yarn global add serve
WORKDIR /app
COPY --from=builder /app/build .
CMD ["serve", "-p", "80", "-s", "."]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment