Commit 0dfc7a30 by zhangxingmin

配置

parent 8e1c2dd6
# 构建阶段 # 使用 Node LTS 作为基础镜像
FROM node:16-alpine as build-stage FROM node:18-alpine
# 设置工作目录
WORKDIR /app WORKDIR /app
# 复制依赖清单
COPY package*.json ./ COPY package*.json ./
RUN npm install # 安装依赖(包含 HBuilderX CLI 工具)
RUN npm install -g @dcloudio/uni-cli && \
npm install
# 复制源码(注意排除无关文件)
COPY . . COPY . .
# 构建 H5 版本(根据实际项目调整)
RUN npm run build:h5 RUN npm run build:h5
# 生产阶段 # 生产阶段
FROM nginx:stable-alpine FROM nginx:stable-alpine
COPY --from=build-stage /app/dist /usr/share/nginx/html COPY --from=build-stage /app/dist /usr/share/nginx/html
......
...@@ -19,9 +19,18 @@ ...@@ -19,9 +19,18 @@
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"echarts": "^5.4.1", "echarts": "^5.4.1",
"js-sha256": "^0.11.1", "js-sha256": "^0.11.1",
"nanoid": "^4.0.0" "nanoid": "^4.0.0",
"uview-ui": "^2.0.31",
"moment": "^2.29.4"
}, },
"devDependencies": { "devDependencies": {
"less": "^4.3.0" "less": "^4.3.0",
"@dcloudio/uni-cli": "^3.0.0"
},
"scripts": {
"dev": "uni -p",
"build:h5": "uni build --platform h5",
"build:weapp": "uni build --platform mp-weixin",
"build:harmony": "uni build --platform harmonyos"
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment