Created
October 10, 2018 00:28
-
-
Save neosarchizo/2524d33fb7e2fea2c1b927c3f80d722a to your computer and use it in GitHub Desktop.
Dockerfile and .dockerignore for create-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
*/node_modules/ | |
*/build/ | |
*/.git/ | |
.gitignore | |
Dockerfile | |
.editorconfig |
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:10.11.0-alpine | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
COPY . . | |
RUN yarn | |
RUN yarn build | |
FROM node:10.11.0-alpine | |
MAINTAINER neosarchizo | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
COPY --from=0 /usr/src/app/build ./build | |
RUN yarn global add serve | |
EXPOSE 5000 | |
CMD ["serve", "-s", "build"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment