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 464B

12345678910111213141516171819202122232425
  1. # 使用 Node 作为基础镜像
  2. FROM alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/node:20.16
  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. RUN npx vite build
  10. # 将项目文件拷贝到工作目录
  11. COPY . .
  12. # 构建项目
  13. RUN npm run build
  14. # 暴露端口
  15. EXPOSE 3000
  16. # 启动应用
  17. CMD ["npm", "run", "serve"]