Created
May 15, 2019 15:58
-
-
Save imyjimmy/0f9bf312a58e6568df5a6b8cb905fd28 to your computer and use it in GitHub Desktop.
example Dockerfiles for React App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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