You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 610B

12345678910111213141516171819202122232425262728
  1. # 使用 Node 作为基础镜像
  2. FROM registry.cn-hangzhou.aliyuncs.com/zsanyu/rcsc:amd64-node-21 as builder
  3. # 设置工作目录
  4. WORKDIR /app
  5. # 拷贝package.json和package-lock.json
  6. COPY package*.json ./
  7. # 安装依赖
  8. RUN npm config set registry https://registry.npmmirror.com && \
  9. npm install
  10. # 将项目文件拷贝到工作目录
  11. COPY . .
  12. # 构建项目
  13. RUN npm run build
  14. FROM nginx:stable-alpine
  15. RUN rm -rf /etc/nginx/conf.d/default.conf
  16. COPY --from=builder /app/dist /usr/share/nginx/html
  17. COPY --from=builder /app/default-nginx.conf /etc/nginx/conf.d/default.conf
  18. # 暴露端口
  19. EXPOSE 80