Commit 53718bc1 by zhangxingmin

push

parent 222bc1c6
FROM node:16
# 构建阶段
FROM node:16-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install --registry=https://registry.npmmirror.com
COPY package.json package-lock.json ./
COPY . .
RUN npm run build:h5
# 先安装依赖,然后更新 Uni-app 相关包
RUN npm install && \
npm update @dcloudio/uni-cli-shared @dcloudio/vue-cli-plugin-uni
# 生产运行阶段
FROM nginx:1.21-alpine
COPY . .
# 删除默认配置
RUN rm -rf /etc/nginx/conf.d/default.conf
RUN npm run build:h5
# 复制自定义Nginx配置
COPY nginx.conf /etc/nginx/conf.d
# 从构建阶段复制产物
COPY --from=builder /app/dist/build/h5 /usr/share/nginx/html
# 生产阶段
FROM nginx:stable-alpine
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 8333
CMD ["nginx", "-g", "daemon off;"]
......@@ -15,20 +15,23 @@
]
},
"dependencies": {
"@dcloudio/vue-cli-plugin-uni": "^3.0.0-27920200625001",
"@vue/cli-service": "^5.0.8",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.13",
"echarts": "^5.4.1",
"js-sha256": "^0.11.1",
"nanoid": "^4.0.0"
"nanoid": "^4.0.0",
"@dcloudio/uni-app": "^3.0.0",
"vue": "^2.6.14"
},
"devDependencies": {
"less": "^4.3.0"
"less": "^4.3.0",
"@dcloudio/uni-h5": "^3.0.0",
"@dcloudio/vue-cli-plugin-uni": "^3.0.0",
"webpack": "^4.46.0"
},
"scripts": {
"dev": "npx uni -p",
"build:h5": "npx vue-cli-service uni-build --platform h5",
"build:weapp": "npx uni build --platform mp-weixin"
"dev": "uni -p h5",
"build:h5": "uni build -p h5",
"test": "echo \"Error: no test specified\" && exit 1"
}
}
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