mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
docker file 1
This commit is contained in:
parent
1614ca1def
commit
1c1e05a8eb
24
cmd/api/deploy.Dockerfile
Normal file
24
cmd/api/deploy.Dockerfile
Normal file
@ -0,0 +1,24 @@
|
||||
FROM golang as build
|
||||
|
||||
# go mod Installation source, container environment variable addition will override the default variable value
|
||||
ENV GO111MODULE=on
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
|
||||
COPY ../* ./Open-IM-Server
|
||||
ENV WORKDIR /Open-IM-Server/cmd/api
|
||||
|
||||
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 apt-get -qq update \
|
||||
&& apt-get -qq install -y --no-install-recommends ca-certificates curl
|
||||
|
||||
RUN make build
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config"]
|
||||
|
||||
CMD ["${WORKDIR}/open_im_api","--port", "10002"]
|
23
script/build_push_k8s_images.sh
Normal file
23
script/build_push_k8s_images.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
version=errcode
|
||||
repository=${1}
|
||||
|
||||
set +e
|
||||
echo "repository: ${repository}"
|
||||
source ./path_info.cfg
|
||||
echo "start to build docker images"
|
||||
currentPwd=${pwd}
|
||||
i=0
|
||||
for path in ${service_source_root[*]}
|
||||
do
|
||||
image="${repository}/${image_names[${i}]}:$version"
|
||||
echo ${image}
|
||||
docker build -t $image . -f ${path}/deploy.Dockerfile
|
||||
echo "build ${image} success"
|
||||
docker push ${image}
|
||||
echo "push ${image} success"
|
||||
echo "=============================="
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
echo "build all images success"
|
@ -48,12 +48,11 @@ service_source_root=(
|
||||
../cmd/rpc/conversation/
|
||||
../cmd/rpc/third/
|
||||
../cmd/crontask
|
||||
../cmd/cmdutils
|
||||
${msg_gateway_source_root}
|
||||
${msg_transfer_source_root/}
|
||||
${msg_source_root}
|
||||
${push_source_root}
|
||||
${sdk_server_source_root}
|
||||
# ${sdk_server_source_root}
|
||||
)
|
||||
#service filename
|
||||
service_names=(
|
||||
@ -67,13 +66,27 @@ service_names=(
|
||||
open_im_conversation
|
||||
open_im_third
|
||||
open_im_cron_task
|
||||
open_im_cmd_utils
|
||||
${msg_gateway_name}
|
||||
${msg_transfer_name}
|
||||
${msg_name}
|
||||
${push_name}
|
||||
${sdk_server_name}
|
||||
# ${sdk_server_name}
|
||||
)
|
||||
|
||||
|
||||
|
||||
image_names=(
|
||||
#api service file
|
||||
api
|
||||
#rpc service file
|
||||
user
|
||||
friend
|
||||
group
|
||||
auth
|
||||
conversation
|
||||
third
|
||||
cron_task
|
||||
msg_gateway
|
||||
msg_transfer
|
||||
msg
|
||||
push
|
||||
# sdk_server
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user