Created
April 10, 2017 19:14
-
-
Save jkinkead/9a915804fde025bc01ca68dde3f2f161 to your computer and use it in GitHub Desktop.
Well-structured Dockerfile for a create-react-app application
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
# You should always specify a full version here to ensure all of your developers | |
# are running the same version of Node. | |
FROM node:7.8.0 | |
# Override the base log level (info). | |
ENV NPM_CONFIG_LOGLEVEL warn | |
# Install and configure `serve`. | |
RUN npm install -g serve | |
CMD serve -s build | |
EXPOSE 5000 | |
# Install all dependencies of the current project. | |
COPY package.json package.json | |
COPY npm-shrinkwrap.json npm-shrinkwrap.json | |
RUN npm install | |
# Copy all local files into the image. | |
COPY . . | |
# Build for production. | |
RUN npm run build --production |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment