From 136d59757b639f58e9cc54f70d6384efb8705cac Mon Sep 17 00:00:00 2001 From: SunnyQjm Date: Mon, 11 Mar 2024 17:43:51 +0800 Subject: [PATCH] feat: Added sysom-openapi-client v1 anolis8.8 Dockerfile --- .../sysom-openapi-client/buildspec.yml | 31 +++++++++ .../sysom-openapi-client/v1/8.8/Dockerfile | 67 +++++++++++++++++++ APPLICATION/sysom-openapi-client/version.yml | 8 +++ 3 files changed, 106 insertions(+) create mode 100644 APPLICATION/sysom-openapi-client/buildspec.yml create mode 100644 APPLICATION/sysom-openapi-client/v1/8.8/Dockerfile create mode 100644 APPLICATION/sysom-openapi-client/version.yml diff --git a/APPLICATION/sysom-openapi-client/buildspec.yml b/APPLICATION/sysom-openapi-client/buildspec.yml new file mode 100644 index 0000000..e83440d --- /dev/null +++ b/APPLICATION/sysom-openapi-client/buildspec.yml @@ -0,0 +1,31 @@ +name: &NAME +version: &VERSION +image_type: &IMAGE_TYPE +baseos_version: &BASEOS_VERSION + +# 定义镜像仓库信息 +repository_info: + acr_anolis: &ACR_ANOLIS anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis + +# 定义镜像测试信息 +t-one: + # 配置测试信息 workspace 和模版 + workspace: &WORKSPACE container_ci_test + project: &PROJECT default_container_ci_test + test_suite: &TEST_SUITE image-ci-test + # 执行测试 case, 多个用数组表示 + test_conf: &TEST_CONF group=container_default_group + cloud_server_tag: &CLOUD_SERVER_TAG [anolis-container-ci-x86, anolis-container-ci-arm] + +images: + BuildSysOMOpenAPIClientApplicationDockerImage: + build: true + platform: [linux/amd64] + docker_file: + path: APPLICATION/sysom-openapi-client/v1/8.8/Dockerfile + scene: + args: [] + tags: [1.0-8.8] + registry: [*ACR_ANOLIS] + # 测试配置 + test_config: [*WORKSPACE, *PROJECT, *TEST_SUITE, *TEST_CONF, '', *CLOUD_SERVER_TAG[0], ''] diff --git a/APPLICATION/sysom-openapi-client/v1/8.8/Dockerfile b/APPLICATION/sysom-openapi-client/v1/8.8/Dockerfile new file mode 100644 index 0000000..e873075 --- /dev/null +++ b/APPLICATION/sysom-openapi-client/v1/8.8/Dockerfile @@ -0,0 +1,67 @@ +FROM openanolis/anolisos:8.8 as downloader +RUN yum install git -y +WORKDIR /root +RUN git clone --branch soc-1.0.3 --single-branch --depth 1 https://gitee.com/anolis/sysom.git + +FROM node:16.20.1 as web_builder +COPY --from=downloader /root/sysom/sysom_web /root/sysom_web +RUN sed -i 's/host: "sysom_api"/host: "sysom_api_hide"/g' /root/sysom_web/src/app.jsx && \ + sed -i "s/redirect: '\/welcome'/redirect: '\/home'/g" /root/sysom_web/config/routes.js && \ + sed -i "s/redirect: '\/welcome'/redirect: '\/home'/g" /root/sysom_web/src/pages/user/Login/index.jsx +WORKDIR /root/sysom_web +RUN mv /root/sysom_web/public/resource/diagnose/v2/multichannel_openapi.json /root/sysom_web/public/resource/diagnose/v2/multichannel.json +RUN mv /root/sysom_web/public/resource/diagnose/v2/locales_openapi.json /root/sysom_web/public/resource/diagnose/v2/locales.json +RUN npm config set registry https://registry.npmmirror.com +RUN yarn config set registry https://registry.npmmirror.com +RUN yarn +RUN yarn build + + +FROM openanolis/anolisos:8.8 as prod + +# Add epel +RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm +RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*" +RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*" + +# Add required yum packages +RUN yum makecache +RUN yum install -y supervisor cronie net-tools +RUN systemctl enable crond +RUN yum install -y python39 +RUN yum install -y nginx +RUN yum install -y redis +RUN yum install -y wget +RUN systemctl enable supervisord +RUN systemctl enable nginx + +# Init sysom-diagnosis +ARG SYSOM_HOME=/usr/local/sysom +ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server + +RUN mkdir /root/sysom +RUN mkdir -p /usr/local/sysom +COPY --from=downloader /root/sysom/conf /root/sysom/conf +COPY --from=downloader /root/sysom/script /root/sysom/script +COPY --from=downloader /root/sysom/deps /root/sysom/deps +COPY --from=downloader /root/sysom/environment /root/sysom/environment +COPY --from=downloader /root/sysom/sysom_server /root/sysom/sysom_server + +RUN mv /root/sysom/environment/0_env/requirements-3.9.txt /root/sysom/environment/0_env/requirements.txt && \ + mv /root/sysom/script/server/sysom_api/requirements-3.9.txt /root/sysom/script/server/sysom_api/requirements.txt && \ + mv /root/sysom/script/server/sysom_cmg/requirements-3.9.txt /root/sysom/script/server/sysom_cmg/requirements.txt && \ + mv /root/sysom/script/server/sysom_diagnosis_openapi/requirements-3.9.txt /root/sysom/script/server/sysom_diagnosis_openapi/requirements.txt && \ + sed -i 's/python3/python3.9/g' /root/sysom/environment/0_env/install.sh +RUN bash -x /root/sysom/script/sysom.sh install deps 0_mysql,1_redis,2_nginx +RUN bash -x /root/sysom/script/sysom.sh install env ALL +RUN bash -x /root/sysom/script/sysom.sh install ms sysom_cmg,sysom_api,sysom_diagnosis_openapi + +COPY --from=web_builder /root/sysom_web/dist /usr/local/sysom/web + +RUN yum clean all + +COPY --from=downloader /root/sysom/docker/sysom-init.service /usr/lib/systemd/system/sysom-init.service +RUN systemctl enable sysom-init.service + +# # 环境准备 +ENTRYPOINT [ "/usr/sbin/init" ] \ No newline at end of file diff --git a/APPLICATION/sysom-openapi-client/version.yml b/APPLICATION/sysom-openapi-client/version.yml new file mode 100644 index 0000000..7ebfa56 --- /dev/null +++ b/APPLICATION/sysom-openapi-client/version.yml @@ -0,0 +1,8 @@ +# 版本关系依赖表,默认继承 version-base.yml 配置,可重写覆盖 +BaseDependency: ../version-base.yml +Dependency: + name: sysom-openapi-client + image_type: application + versions: + general: + baseos_version: [[ignored]] -- Gitee