Dockerfile 441 B

123456789101112131415161718192021
  1. FROM node:16-alpine as build-stage
  2. WORKDIR /admim
  3. COPY .npmrc package.json yarn.lock ./
  4. RUN --mount=type=cache,id=yarn-store,target=/root/.yarn-store \
  5. yarn install --frozen-lockfile
  6. COPY . .
  7. ARG NODE_ENV=""
  8. RUN env ${NODE_ENV} yarn build:prod
  9. ## -- stage: dist => nginx --
  10. FROM nginx:alpine
  11. ENV TZ=Asia/Shanghai
  12. COPY ./nginx.conf /etc/nginx/conf.d/default.conf
  13. COPY --from=build-stage /admim/dist /usr/share/nginx/html
  14. EXPOSE 80