Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rossmaclean
Created October 14, 2020 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rossmaclean/23b4b7fa85e6a6cd79a0de3d30298481 to your computer and use it in GitHub Desktop.
Save rossmaclean/23b4b7fa85e6a6cd79a0de3d30298481 to your computer and use it in GitHub Desktop.
# build environment
FROM node:13.12.0-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
RUN npm ci --silent
RUN npm install react-scripts@3.4.1 -g --silent
COPY . ./
RUN npm run build
# production environment
FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment