Skip to content

Instantly share code, notes, and snippets.

@lysandroc
Created June 7, 2019 22:40
Show Gist options
  • Save lysandroc/9d4d86eca92cedd0d4e6326a50bb0e55 to your computer and use it in GitHub Desktop.
Save lysandroc/9d4d86eca92cedd0d4e6326a50bb0e55 to your computer and use it in GitHub Desktop.
dockerfile for react app
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"]
template react dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment