Docker安装升讯威在线客服与营销系统
安装
下载私有化部署包
解压下载的压缩包
在解压的目录新建一个
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17FROM centos:centos7.9.2009
WORKDIR /wwwroot
COPY init.sh /tmp/sh/
COPY appsettings.json /tmp/config/
COPY Management /wwwroot/Management
COPY Resource /wwwroot/Resource
COPY Server /wwwroot/Server
RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm && yum -y install dnf && dnf install dotnet-sdk-3.1 -y && rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && yum install libgdiplus-devel nginx -y && ln -s /usr/lib64/libgdiplus.so /usr/lib/gdiplus.dll && ln -s /usr/lib64/libgdiplus.so /usr/lib64/gdiplus.dll && chmod +x /tmp/sh/init.sh && systemctl enable nginx
COPY default.conf /etc/nginx/conf.d/
EXPOSE 80
ENTRYPOINT ["/tmp/sh/init.sh"]创建初始化启动脚本,在解压的目录新建一个
init.sh
1
2
3
4
5
6
cp /tmp/config/appsettings.json /wwwroot/Server/appsettings.json
nginx
nginx -s reload
cd /wwwroot/Server
dotnet Sheng.Linkup.Server.dllnginx代理配置,在解压的目录新建一个
default.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72# https://kf.shengxunwei.com
# Start
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream dotnet_server_proxy {
server localhost:5000;
keepalive 2000;
}
# kf-api (Server)
server{
listen 80;
listen [::]:80;
server_name kf-api.domain.io;
location / {
proxy_pass http://dotnet_server_proxy;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
# kf-resource (Resource)
server {
listen 80;
server_name kf-resource.domain.io;
location / {
root /wwwroot/Resource;
index v.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
# kf-m (Management)
server {
listen 80;
server_name kf-m.domain.io;
location / {
root /wwwroot/Management;
index index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
# End
# https://kf.shengxunwei.com在解压的目录新建一个
appsettings.json
配置,里面进行mysql数据库配置,初始化脚本在:数据库建表脚本/CreateDatabase_MySql.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54{
"Version": 3,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"DatabaseEngine": "mysql",
"ConnectionStrings": {
"DefaultConnection": "Server=172.1.1.2;database=kf_shengxunwei;user=root;password=Tech@2023"
},
"AppSettings": {
"FileStore": {
"Store": "static",
"AliOSS": {
"AccessKeyId": null,
"AccessKeySecret": null,
"BucketName": null,
"PublicAddress": null,
"EndPoint": null
}
},
"Email": {
"Account": "",
"Password": ""
},
"Translation": {
"Engine": "",
"Youdao": {
"AppKey": null,
"AppSecret": null
},
"Baidu": {
"AppId": null,
"AppSecret": null
}
},
"Environment": {
"DefaultLanguage": "zh-CHS",
"CustomerContext": {
"HeartbeatTimeoutSecond": 70,
"CellphoneHeartbeatTimeoutSecond": 70,
"OfflineOverSecond": 70
},
"TcpIpAddress": "172.1.1.44",
"TcpPort": "9527",
"ResourceAddress": "http://kf-resource.domain.com.cn",
"HostAddress": "http://kf-api.domian.com.cn"
}
}
}执行
docker build -t harbor.domain.dev/base/shengxunwei:1.3 .
运行
docker run harbor.domain.dev/base/shengxunwei:1.3
配置
Resource
对应客户访问的界面
Management
对应客服管理后台界面
ApiUrl
:http://kf-api.domain.io
ResourceUrl
:http://kf-resource.domain.io
管理后台地址
:http://kf-m.domain.io
需要修改下面几个文件里面的ApiUrl和ResourceUrl
1 | /wwwroot/Resource/embedded.js |
使用
客户访问http://kf-resource.domain.io/WebChat/MobileWebChat.html?siteCode=freesite
客服下载客户端,两个就能进行聊天了