Created
June 7, 2019 22:40
-
-
Save lysandroc/9d4d86eca92cedd0d4e6326a50bb0e55 to your computer and use it in GitHub Desktop.
dockerfile 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.11.1-alpine | |
# Provides cached layer for node_modules | |
ADD package.json /tmp/package.json | |
RUN cd /tmp && npm install | |
RUN mkdir -p /app && cp -a /tmp/node_modules /app/node_modules | |
# Define working directory | |
WORKDIR /app | |
# Add everything in the current directory to our image, in the 'app' folder. | |
COPY ./src/ ./src | |
COPY ./public/ ./public | |
COPY ./package.json ./package.json | |
#RUN npm install -g npm-run-all | |
#RUN npm install -g [email protected] | |
#RUN npm install -g [email protected] | |
RUN npm run build | |
# Run our app. | |
CMD ["npm", "start"] |
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
template react dockerfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment