Dockerfile 619 B

1234567891011121314151617181920212223242526272829
  1. FROM node:14-alpine AS deps
  2. ARG REACT_APP_INCLUDE_GTAG=false
  3. RUN mkdir /opt/node_app && chown node:node /opt/node_app
  4. WORKDIR /opt/node_app
  5. USER node
  6. COPY package.json package-lock.json ./
  7. RUN npm install --no-optional && npm cache clean --force
  8. ENV PATH /opt/node_app/node_modules/.bin:$PATH
  9. WORKDIR /opt/node_app
  10. COPY . .
  11. FROM node:14-alpine AS build
  12. ARG NODE_ENV=production
  13. WORKDIR /opt/node_app
  14. COPY --from=deps /opt/node_app .
  15. RUN npm run build:app:docker
  16. FROM nginx:1.17-alpine
  17. COPY --from=build /opt/node_app/build /usr/share/nginx/html
  18. HEALTHCHECK CMD wget -q -O /dev/null http://localhost || exit 1