1
0
mirror of https://github.com/142vip/408CSFamily.git synced 2026-11-29 23:45:43 +08:00

feat: 修改编译、打包流程,优化脚本

This commit is contained in:
早睡早起
2023-08-29 18:46:12 +08:00
parent f1adb3796d
commit cfa50ae38e
11 changed files with 2434 additions and 2058 deletions

View File

@@ -1,15 +1,24 @@
#
# - 功能: 408CSFamily镜像构建
# - 用法: docker build -f Dockerfile --build-arg APP_VERSION=0.0.1 -t 408CSFamily-0.0.1 .
# - 用法: docker build -f Dockerfile --build-arg APP_VERSION=0.0.1 --build-arg CONTAINER_BUILD=true -t 408CSFamily-0.0.1 .
# - 参数:
# APP_VERSION: 版本
# CONTAINER_BUILD: 采用容器构建
#
# 注意:vite构建需要支持node14以上,安装node16较为稳妥
## 注意:vite构建需要支持node14以上,安装node16较为稳妥
FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:16.12.0-alpine AS build_base
RUN mkdir -p /apps
ARG CONTAINER_BUILD
WORKDIR /apps
COPY . .
RUN npm i pnpm@6 -g && pnpm i -D && pnpm build
RUN echo $CONTAINER_BUILD
## 基于容器自动构建
RUN if [ "$CONTAINER_BUILD" = "true" ]; then \
npm i pnpm@7 -g && pnpm i -D && pnpm build; \
fi;
FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.23.0-alpine