Commit 3a3f70b9 by zhangxingmin

push

parent 3a96ad8a
.git
node_modules
unpackage
dist
.hbuilderx
*.log
*.md
hbuilderx.tar.gz # 构建完成后自动删除
# 构建阶段
FROM node:18-alpine AS builder FROM node:18-alpine AS builder
WORKDIR /app WORKDIR /app
# 安装依赖(利用层缓存)
COPY package*.json ./ COPY package*.json ./
RUN npm ci
# 复制源代码 # 设置淘宝镜像源并安装
COPY . . RUN npm config set registry https://registry.npmmirror.com && \
npm ci --prefer-offline
# 使用 package.json 中定义的构建命令 COPY . .
ARG BUILD_ENV=production RUN npm run build:h5
RUN npm run build:${BUILD_ENV}
# 使用Nginx作为运行环境 # 使用Nginx作为运行环境
FROM nginx:alpine FROM nginx:alpine
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
] ]
}, },
"scripts": { "scripts": {
"build:h5": "uni build -p h5", "build:h5": "uni build -p h5"
"build:prod": "VUE_APP_ENV=production uni build -p h5"
}, },
"dependencies": { "dependencies": {
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
...@@ -27,14 +26,12 @@ ...@@ -27,14 +26,12 @@
"nanoid": "^4.0.0" "nanoid": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {
"@dcloudio/uni-h5": "^3.0.0", "@dcloudio/uni-h5": "3.0.0-alpha-3070320211214001",
"@dcloudio/vue-cli-plugin-uni": "^2.0.0", "@dcloudio/vue-cli-plugin-uni": "2.0.0-3070320211214001",
"@dcloudio/uni-migration": "2.0.0-3070320211214001",
"less": "^4.3.0" "less": "^4.3.0"
}, },
"engines": { "engines": {
"node": ">=16.0.0" "node": ">=16.0.0"
},
"docker": {
"outputDir": "unpackage/dist/build/h5"
} }
} }
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