Commit de8f66f4 by zhangxingmin

push

parent 9d98389e
......@@ -20,38 +20,15 @@ RUN apt-get update && \
# 设置工作目录
WORKDIR /app
# 通过构建参数接收 HBuilderX 路径
ARG HBUILDERX_PATH
ENV HBUILDERX_PATH=$HBUILDERX_PATH
ENV PATH="$HBUILDERX_PATH:${PATH}"
# 复制项目文件
COPY . .
# 验证 HBuilderX
RUN echo "### 验证 HBuilderX 安装 ###" && \
if [ -f "$HBUILDERX_PATH/cli" ]; then \
echo "HBuilderX CLI 存在" && \
chmod +x "$HBUILDERX_PATH/cli" && \
echo "版本信息: " && "$HBUILDERX_PATH/cli" --version; \
else \
echo "错误:HBuilderX CLI 不存在!" && \
echo "路径: $HBUILDERX_PATH" && \
ls -la "$HBUILDERX_PATH" || true; \
exit 1; \
fi
# 使用国内 npm 源安装依赖
# 使用国内npm源安装依赖
RUN npm config set registry https://registry.npmmirror.com && \
npm install
# 设置构建参数
ARG BUILD_PLATFORM=h5
ENV UNI_PLATFORM=$BUILD_PLATFORM
# 执行构建
RUN echo "### 开始项目构建 ###" && \
cli build --project /app --platform $BUILD_PLATFORM
RUN npm run build
# ===================================================
# 第二阶段:运行环境
......@@ -61,7 +38,7 @@ FROM nginx:1.25.2-alpine AS h5-runtime
COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf
# 复制构建产物
COPY --from=builder /app/unpackage/dist/build/h5 /usr/share/nginx/html
COPY --from=builder /app/dist/build/h5 /usr/share/nginx/html
# 暴露端口
EXPOSE 8333
......
......@@ -16,10 +16,11 @@
]
},
"scripts": {
"build:h5": "cli build --project . --platform h5",
"build:android": "cli build --project . --platform android",
"build:ios": "cli build --project . --platform ios",
"start": "nginx -g 'daemon off;'"
"serve": "npm run dev:h5",
"build": "npm run build:h5",
"build:h5": "vue-cli-service uni-build --platform h5",
"dev:h5": "vue-cli-service uni-serve --platform h5",
"build:mp-weixin": "vue-cli-service uni-build --platform mp-weixin"
},
"dependencies": {
"crypto-js": "^4.2.0",
......@@ -27,10 +28,26 @@
"echarts": "^5.4.1",
"js-sha256": "^0.11.1",
"nanoid": "^4.0.0",
"@dcloudio/uni-app": "^4.75.0",
"vue": "^3.0.0"
"@dcloudio/uni-app": "^3.0.0-alpha-3000020220422001",
"@dcloudio/uni-h5": "^3.0.0-alpha-3000020220422001",
"@dcloudio/uni-mp-weixin": "^3.0.0-alpha-3000020220422001",
"core-js": "^3.8.3",
"vue": "^2.6.11"
},
"devDependencies": {
"less": "^4.3.0"
}
"less": "^4.3.0",
"@dcloudio/types": "^3.0.0-alpha-3000020220422001",
"@dcloudio/vue-cli-plugin-uni": "^2.0.0-3000020220422001",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-plugin-import": "^1.13.3",
"sass": "^1.32.13",
"sass-loader": "^10.2.0",
"vue-template-compiler": "^2.6.11"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
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