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

123456789101112131415161718192021222324
  1. # 使用 Node 作为基础镜像
  2. FROM registry.cn-hangzhou.aliyuncs.com/zsanyu/rcsc:amd64-node-21
  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 npx vite build
  14. # 暴露端口
  15. EXPOSE 3000
  16. # 启动应用
  17. CMD ["npm", "run", "serve"]