You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KBQA/docker/演示环境服务部署文档.md

77 lines
2.1 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 虚拟病人服务部署文档
## 需要部署的服务列表
1. 后端系统
2. nginx前端服务
# 注意
如果镜像拉的时候,报错:
Error response from daemon: error parsing HTTP 408 response body:
invalid character '<' looking for beginning of value:
"<html><body><h1>408 Request Time-out</h1>\n
Your browser didn't send a complete request in time.\n</body></html>\n"
这个时候,需要修改网卡地址
先ifconfig,找到对应网卡的地址,然后指定命令
ifconfig {eth0} mtu 900
## 后端系统部署
- 端口号8891
- 首次部署使用dockerfile的形式,后期更新直接docker restart就可以了
- 将代码包virtual-patient-manage-1.0-SNAPSHOT.jar拷贝到路径/data/vp下
### 首次部署
~~~shell
# 进入/data/kbqa/kbqa-graph文件夹依次执行命令
# 构建镜像
docker build -t kbqa-graph:1.0.0 .
# 验证镜像是否存在
docker images | grep kbqa-graph
# 运行容器
docker run --name kbqa-graph -p 9811:9811 -v /data/kbqa:/data/kbqa -d kbqa-graph:1.0.0
# 验证容器运行
docker ps | grep kbqa-graph
# 查看日志是否正常
docker logs -f kbqa-graph
~~~
### 服务更新
- 将代码包kbqa-graph-1.0-SNAPSHOT.jar拷贝到路径/data/kbqa
- 重启容器
~~~shell
docker restart kbqa-graph
~~~
## Nginx前端服务
~~~shell
# 进入nginx文件夹依次执行命令
# 构建镜像 1.0.0
docker build -t kbqa-nginx:1.0.0 .
# 验证镜像是否存在
docker images | grep kbqa-nginx
# 运行容器
#将前端代码包dist文件夹拷贝到路径/data/kbqa/下
docker run -itd --name kbqa-nginx -p 1080:80 -e UPSTREAM_KG_SERVERS={ip}:{port} -v /data/kbqa:/usr/share/nginx/html kbqa-nginx:1.0.0
# UPSTREAM_KG_SERVERS:只是问答服务ip:port
- 示例:
-- docker run -itd --name kbqa-nginx -p 1080:80 -e UPSTREAM_KG_SERVERS=192.168.10.138:9811 -v /data/kbqa:/usr/share/nginx/html kbqa-nginx:1.0.0
# 验证容器运行
docker ps | grep kbqa-nginx
# 查看日志是否正常
docker logs -f kbqa-nginx
~~~
### 服务更新
- 将前端代码包dist文件夹拷贝到路径/data/kbqa/下即可