This commit is contained in:
wangchuxiao
2023-02-09 20:36:34 +08:00
parent 8a1702fcf7
commit 759432794f
216 changed files with 2299 additions and 4059 deletions
+18
View File
@@ -0,0 +1,18 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_cms_api $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main
+56
View File
@@ -0,0 +1,56 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cms-api-deployment
spec:
selector:
matchLabels:
app: cms-api # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: cms-api # 标签
spec:
containers:
- name: cms-api
image: openim/cms_api:v2.3.4
imagePullPolicy: Always
ports:
- containerPort: 10006
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
- name: usualConfig
mountPath: /Open-IM-Server/config
readOnly: true
env:
- name: CONFIG_NAME
value: "/Open-IM-Server"
- name: USUAL_CONFIG_NAME
value: "/Open-IM-Server"
volumes:
- name: config
configMap:
name: openim-config
- name: usualConfig
configMap:
name: openim-usualConfig
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: cms-api
spec:
ports:
- name: cms-api-port
protocol: TCP
port: 10006
targetPort: 10006
selector:
app: cms-api
type: NodePort