From 6b2b352ad881722ceaeaa428137f5cc176fb6c66 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Sat, 10 Jun 2023 22:59:16 +0800 Subject: [PATCH] feat: change directory Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- .gitignore | 2 +- README-zh_CN.md | 2 +- README.md | 2 +- README_zh.md | 2 +- cmd/openim-sdk-core | 1 - deploy.Dockerfile | 31 +++++++++++++---------- deploy/config.example.yaml | 2 -- deploy/dockerfiles/Dockerfile.msg_gateway | 1 - deploy/dockerfiles/Dockerfile.rpc_auth | 1 - deploy/readme.md | 2 +- deploy_k8s/auth/auth.Dockerfile | 1 - script/build_images.sh | 2 +- script/make-rules/golang.mk | 2 +- script/path_info.cfg | 2 +- script/win_build_all_service.cmd | 2 +- 15 files changed, 27 insertions(+), 28 deletions(-) delete mode 160000 cmd/openim-sdk-core diff --git a/.gitignore b/.gitignore index 63a6a3901..c72b9060c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,7 @@ deploy/open_im_rpc_friend deploy/open_im_rpc_group deploy/open_im_rpc_msg deploy/open_im_rpc_auth -deploy/Open-IM-SDK-Core +deploy/openim-sdk-core # files used by the developer .idea.md diff --git a/README-zh_CN.md b/README-zh_CN.md index e97439b17..7dc8b8b35 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -93,7 +93,7 @@ Open-IM-Server 是一款即时通讯服务器,使用纯 Golang 开发,采用 ``` git clone --recursive - cd cmd/Open-IM-SDK-Core + cd cmd/openim-sdk-core git checkout main ``` diff --git a/README.md b/README.md index a62646527..f44c4a3cb 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ By deployment of the Open-IM-Server on the customer's server, developers can int ```shell git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive -cd cmd/Open-IM-SDK-Core +cd cmd/openim-sdk-core git checkout main ``` diff --git a/README_zh.md b/README_zh.md index e97439b17..7dc8b8b35 100644 --- a/README_zh.md +++ b/README_zh.md @@ -93,7 +93,7 @@ Open-IM-Server 是一款即时通讯服务器,使用纯 Golang 开发,采用 ``` git clone --recursive - cd cmd/Open-IM-SDK-Core + cd cmd/openim-sdk-core git checkout main ``` diff --git a/cmd/openim-sdk-core b/cmd/openim-sdk-core deleted file mode 160000 index 4ce07f10e..000000000 --- a/cmd/openim-sdk-core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4ce07f10e42ac2d6a6bc85a34f05c1ada6f4e5a3 diff --git a/deploy.Dockerfile b/deploy.Dockerfile index 309e4ba0f..cd518f566 100644 --- a/deploy.Dockerfile +++ b/deploy.Dockerfile @@ -6,29 +6,34 @@ ENV GOPROXY=https://goproxy.cn,direct # Set up the working directory WORKDIR /Open-IM-Server - # add all files to the container COPY . . -RUN chmod +x /Open-IM-Server/script/*.sh && \ - /bin/sh -c /Open-IM-Server/script/build_all_service.sh - -#Blank image Multi-Stage Build -FROM alpine +WORKDIR /Open-IM-Server/script +RUN chmod +x *.sh -RUN apk add --no-cache vim curl tzdata gawk procps net-tools +RUN /bin/sh -c ./build_all_service.sh +#Blank image Multi-Stage Build +FROM ubuntu + +RUN rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ +&&apt-get install net-tools +#Non-interactive operation +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get install -y vim curl tzdata gawk #Time zone adjusted to East eighth District -RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ - dpkg-reconfigure -f noninteractive tzdata +RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata + #set directory to map logs,config file,script file. VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] -#Copy script files and binary files to the blank image -COPY --from=build --chown=root:root /Open-IM-Server/script /Open-IM-Server/script -COPY --from=build --chown=root:root /Open-IM-Server/bin /Open-IM-Server/bin +#Copy scripts files and binary files to the blank image +COPY --from=build /Open-IM-Server/script /Open-IM-Server/script +COPY --from=build /Open-IM-Server/bin /Open-IM-Server/bin WORKDIR /Open-IM-Server/script -CMD ["/Open-IM-Server/script/docker_start_all.sh"] +CMD ["./docker_start_all.sh"] \ No newline at end of file diff --git a/deploy/config.example.yaml b/deploy/config.example.yaml index 7d30668e9..b6fad89d0 100644 --- a/deploy/config.example.yaml +++ b/deploy/config.example.yaml @@ -179,5 +179,3 @@ demo: senderAuthorizationCode: smtpAddr: smtpPort: - - diff --git a/deploy/dockerfiles/Dockerfile.msg_gateway b/deploy/dockerfiles/Dockerfile.msg_gateway index ffd012bc4..2380a5882 100644 --- a/deploy/dockerfiles/Dockerfile.msg_gateway +++ b/deploy/dockerfiles/Dockerfile.msg_gateway @@ -11,6 +11,5 @@ ADD ./open_im_msg_gateway $WORKDIR/main RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ chmod +x $WORKDIR/main - WORKDIR $WORKDIR CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_auth b/deploy/dockerfiles/Dockerfile.rpc_auth index a8e50fdb1..bb4d3b0a7 100644 --- a/deploy/dockerfiles/Dockerfile.rpc_auth +++ b/deploy/dockerfiles/Dockerfile.rpc_auth @@ -11,6 +11,5 @@ ADD ./open_im_rpc_auth $WORKDIR/main RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ chmod +x $WORKDIR/main - WORKDIR $WORKDIR CMD ./main \ No newline at end of file diff --git a/deploy/readme.md b/deploy/readme.md index 61fbd9700..7e004178b 100644 --- a/deploy/readme.md +++ b/deploy/readme.md @@ -6,7 +6,7 @@ make win-build-all # 得到各个二进制程序之后,打包为镜像 -# 目前没有处理 Open-IM-SDK-Core ,需要的话可以自己单独处理这个模块 +# 目前没有处理 openim-sdk-core ,需要的话可以自己单独处理这个模块 make image-all # docker-compose.yaml 分成了两部分,一部分是openIM的镜像容器 openim.yaml,一部分是依赖的环境 env.yaml diff --git a/deploy_k8s/auth/auth.Dockerfile b/deploy_k8s/auth/auth.Dockerfile index 15eafd782..2d5086cac 100644 --- a/deploy_k8s/auth/auth.Dockerfile +++ b/deploy_k8s/auth/auth.Dockerfile @@ -14,6 +14,5 @@ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \ VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] - WORKDIR $CMDDIR CMD ./main \ No newline at end of file diff --git a/script/build_images.sh b/script/build_images.sh index ad37e24e4..dca086ab3 100755 --- a/script/build_images.sh +++ b/script/build_images.sh @@ -4,7 +4,7 @@ rm Open-IM-Server -rf git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive cd Open-IM-Server git checkout tuoyun -cd cmd/Open-IM-SDK-Core/ +cd cmd/openim-sdk-core/ git checkout tuoyun cd ../../ docker build -t $image . -f deploy.Dockerfile diff --git a/script/make-rules/golang.mk b/script/make-rules/golang.mk index a3dac81af..8d36620b7 100644 --- a/script/make-rules/golang.mk +++ b/script/make-rules/golang.mk @@ -70,7 +70,7 @@ EXCLUDE_TESTS=github.com/OpenIMSDK/Open-IM-Server/test github.com/OpenIMSDK/Open # ============================================================================== # ❯ tree -L 1 cmd # cmd -# ├── Open-IM-SDK-Core/ - main.go +# ├── openim-sdk-core/ - main.go # ├── open_im_api # ├── open_im_cms_api # ├── open_im_cron_task diff --git a/script/path_info.cfg b/script/path_info.cfg index 2d2d223d9..125d13c9a 100644 --- a/script/path_info.cfg +++ b/script/path_info.cfg @@ -21,7 +21,7 @@ msg_transfer_service_num=4 sdk_server_name="open_im_sdk_server" sdk_server_binary_root="../bin/" -sdk_server_source_root="../cmd/Open-IM-SDK-Core/" +sdk_server_source_root="../cmd/openim-sdk-core/" demo_server_name="open_im_demo" demo_server_binary_root="../bin/" diff --git a/script/win_build_all_service.cmd b/script/win_build_all_service.cmd index 9ec7313ae..e2b4a2b52 100644 --- a/script/win_build_all_service.cmd +++ b/script/win_build_all_service.cmd @@ -18,5 +18,5 @@ cd ..\..\..\cmd\rpc\open_im_office\&& go build -ldflags="-w -s" && move open_im_ cd ..\..\..\cmd\rpc\open_im_organization\&& go build -ldflags="-w -s" && move open_im_organization.exe %ROOT%\..\bin\ cd ..\..\..\cmd\rpc\open_im_statistics\&& go build -ldflags="-w -s" && move open_im_statistics.exe %ROOT%\..\bin\ cd ..\..\..\cmd\rpc\open_im_user\&& go build -ldflags="-w -s" && move open_im_user.exe %ROOT%\..\bin\ -cd ..\..\..\cmd\Open-IM-SDK-Core\ws_wrapper\cmd\&& go build -ldflags="-w -s" open_im_sdk_server.go && move open_im_sdk_server.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\openim-sdk-core\ws_wrapper\cmd\&& go build -ldflags="-w -s" open_im_sdk_server.go && move open_im_sdk_server.exe %ROOT%\..\bin\ cd %ROOT% \ No newline at end of file