Skip to content

Instantly share code, notes, and snippets.

@neosarchizo
Created October 10, 2018 00:28
Show Gist options
  • Save neosarchizo/2524d33fb7e2fea2c1b927c3f80d722a to your computer and use it in GitHub Desktop.
Save neosarchizo/2524d33fb7e2fea2c1b927c3f80d722a to your computer and use it in GitHub Desktop.
Dockerfile and .dockerignore for create-react-app
*/node_modules/
*/build/
*/.git/
.gitignore
Dockerfile
.editorconfig
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