Dockerfile 431 B

12345678910111213141516
  1. FROM node:lts-alpine
  2. WORKDIR /build
  3. # 设置Node-Sass的镜像地址
  4. # RUN npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
  5. # 设置npm镜像
  6. RUN npm config set registry https://registry.npm.taobao.org
  7. COPY package.json /build/package.json
  8. RUN yarn
  9. COPY ./ /build
  10. RUN npm run build
  11. FROM nginx
  12. RUN mkdir /app
  13. COPY --from=0 /build/dist /app
  14. COPY --from=0 /build/nginx.conf /etc/nginx/nginx.conf
  15. EXPOSE 9001