Commit fa54f00a9d04c5823be1a38d20ca1f70dbcd3508

Authored by xiaoxie
1 parent 460bd4f9

尝试docker-compose启动

docker/docker-compose.yml
@@ -12,6 +12,9 @@ services: @@ -12,6 +12,9 @@ services:
12 wvp: 12 wvp:
13 build: 13 build:
14 context: ./wvp 14 context: ./wvp
  15 + args:
  16 + gitUrl: "https://gitee.com/xieyu1989"
  17 + zlmGitUrl: "https://gitee.com/xia-chu/ZLMediaKit"
15 restart: always 18 restart: always
16 ports: 19 ports:
17 - "5060:5060" 20 - "5060:5060"
@@ -24,8 +27,20 @@ services: @@ -24,8 +27,20 @@ services:
24 - "30000-30500:30000-30500/udp" 27 - "30000-30500:30000-30500/udp"
25 volumes: 28 volumes:
26 - ./video:/opt/media/www/record/ 29 - ./video:/opt/media/www/record/
  30 + - ./logs/wvp:/opt/wvp/logs/
  31 + - ./logs/assist:/opt/assist/logs/
  32 + - ./logs/media:/opt/media/logs/
27 environment: 33 environment:
28 TZ: "Asia/Shanghai" 34 TZ: "Asia/Shanghai"
  35 + REDIS_HOST: redis
  36 + REDIS_PORT: 6379
  37 + REDIS_PWD: root
  38 + WVP_DOMAIN: 6101130049
  39 + WVP_ID: 61011300490000000001
  40 + # [必须修改] 本机的IP
29 WVP_HOST: 172.18.0.61 41 WVP_HOST: 172.18.0.61
  42 + WVP_PWD: aseqw_+hiy123
  43 + ASSIST_CONFIG:
  44 + WVP_CONFIG:
30 depends_on: 45 depends_on:
31 - redis 46 - redis
docker/wvp/Dockerfile
1 FROM ubuntu:20.04 AS build 1 FROM ubuntu:20.04 AS build
2 2
  3 +ARG gitUrl="https://gitee.com/18010473990"
  4 +ARG zlmGitUrl="https://gitee.com/xia-chu/ZLMediaKit"
  5 +
3 RUN export DEBIAN_FRONTEND=noninteractive &&\ 6 RUN export DEBIAN_FRONTEND=noninteractive &&\
4 apt-get update && \ 7 apt-get update && \
5 apt-get install -y --no-install-recommends openjdk-11-jre git maven nodejs npm build-essential \ 8 apt-get install -y --no-install-recommends openjdk-11-jre git maven nodejs npm build-essential \
6 cmake ca-certificates openssl ffmpeg && \ 9 cmake ca-certificates openssl ffmpeg && \
7 10
8 cd /home && \ 11 cd /home && \
9 - git clone https://gitee.com/18010473990/maven.git && \ 12 + git clone ${gitUrl}/maven.git && \
10 cp maven/settings.xml /usr/share/maven/conf/ && \ 13 cp maven/settings.xml /usr/share/maven/conf/ && \
11 - git clone https://gitee.com/18010473990/wvp-GB28181.git && \  
12 - git clone https://gitee.com/18010473990/wvp-pro-assist.git && \  
13 - git clone --depth=1 https://gitee.com/xia-chu/ZLMediaKit && \ 14 + git clone ${gitUrl}/wvp-GB28181.git && \
  15 + git clone ${gitUrl}/wvp-pro-assist.git && \
  16 + git clone --depth=1 ${zlmGitUrl} && \
14 mkdir -p /opt/wvp/config /opt/assist/config /opt/media/www/record && \ 17 mkdir -p /opt/wvp/config /opt/assist/config /opt/media/www/record && \
15 18
16 cd /home/wvp-GB28181/web_src && \ 19 cd /home/wvp-GB28181/web_src && \
@@ -63,6 +66,7 @@ EXPOSE 30000-30500/tcp @@ -63,6 +66,7 @@ EXPOSE 30000-30500/tcp
63 EXPOSE 30000-30500/udp 66 EXPOSE 30000-30500/udp
64 67
65 RUN export DEBIAN_FRONTEND=noninteractive &&\ 68 RUN export DEBIAN_FRONTEND=noninteractive &&\
  69 + export LANG=zh_CN.UTF-8
66 apt-get update && \ 70 apt-get update && \
67 apt-get install -y --no-install-recommends openjdk-11-jre ca-certificates ffmpeg language-pack-zh-hans && \ 71 apt-get install -y --no-install-recommends openjdk-11-jre ca-certificates ffmpeg language-pack-zh-hans && \
68 apt-get autoremove -y && \ 72 apt-get autoremove -y && \
src/main/resources/application-dev.yml
@@ -2,13 +2,13 @@ spring: @@ -2,13 +2,13 @@ spring:
2 # REDIS数据库配置 2 # REDIS数据库配置
3 redis: 3 redis:
4 # [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1 4 # [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1
5 - host: 127.0.0.1 5 + host: ${REDIS_HOST:127.0.0.1}
6 # [必须修改] 端口号 6 # [必须修改] 端口号
7 - port: 6379 7 + port: ${REDIS_PORT:6379}
8 # [可选] 数据库 DB 8 # [可选] 数据库 DB
9 database: 6 9 database: 6
10 # [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接 10 # [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接
11 - password: 11 + password: ${REDIS_PWD}
12 # [可选] 超时时间 12 # [可选] 超时时间
13 timeout: 10000 13 timeout: 10000
14 # [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置 14 # [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置
@@ -36,18 +36,18 @@ server: @@ -36,18 +36,18 @@ server:
36 # 作为28181服务器的配置 36 # 作为28181服务器的配置
37 sip: 37 sip:
38 # [必须修改] 本机的IP 38 # [必须修改] 本机的IP
39 - ip: 192.168.0.100 39 + ip: ${WVP_HOST}
40 # [可选] 28181服务监听的端口 40 # [可选] 28181服务监听的端口
41 port: 5060 41 port: 5060
42 # 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007) 42 # 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)
43 # 后两位为行业编码,定义参照附录D.3 43 # 后两位为行业编码,定义参照附录D.3
44 # 3701020049标识山东济南历下区 信息行业接入 44 # 3701020049标识山东济南历下区 信息行业接入
45 # [可选] 45 # [可选]
46 - domain: 4401020049 46 + domain: ${WVP_DOMAIN:4401020049}
47 # [可选] 47 # [可选]
48 - id: 44010200492000000001 48 + id: ${WVP_ID:44010200492000000001}
49 # [可选] 默认设备认证密码,后续扩展使用设备单独密码, 移除密码将不进行校验 49 # [可选] 默认设备认证密码,后续扩展使用设备单独密码, 移除密码将不进行校验
50 - password: admin123 50 + password: ${WVP_PWD:admin123}
51 51
52 #zlm 默认服务器配置 52 #zlm 默认服务器配置
53 media: 53 media:
@@ -66,8 +66,9 @@ media: @@ -66,8 +66,9 @@ media:
66 # [可选] 国标级联在此范围内选择端口发送媒体流, 66 # [可选] 国标级联在此范围内选择端口发送媒体流,
67 send-port-range: 30000,30500 # 端口范围 67 send-port-range: 30000,30500 # 端口范围
68 # 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用 68 # 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用
69 - record-assist-port: 0  
70 - 69 + record-assist-port: 18081
  70 + sdp-ip: ${WVP_HOST}
  71 + stream-ip: ${WVP_HOST}
71 # [可选] 日志配置, 一般不需要改 72 # [可选] 日志配置, 一般不需要改
72 logging: 73 logging:
73 file: 74 file:
@@ -84,6 +85,7 @@ logging: @@ -84,6 +85,7 @@ logging:
84 user-settings: 85 user-settings:
85 # 推流直播是否录制 86 # 推流直播是否录制
86 record-push-live: true 87 record-push-live: true
  88 + auto-apply-play: false
87 89
88 # 在线文档: swagger-ui(生产环境建议关闭) 90 # 在线文档: swagger-ui(生产环境建议关闭)
89 swagger-ui: 91 swagger-ui:
@@ -93,4 +95,4 @@ swagger-ui: @@ -93,4 +95,4 @@ swagger-ui:
93 version: 95 version:
94 version: "@project.version@" 96 version: "@project.version@"
95 description: "@project.description@" 97 description: "@project.description@"
96 - artifact-id: "@project.artifactId@"  
97 \ No newline at end of file 98 \ No newline at end of file
  99 + artifact-id: "@project.artifactId@"
src/main/resources/application.yml
1 spring: 1 spring:
2 profiles: 2 profiles:
3 - active: local  
4 \ No newline at end of file 3 \ No newline at end of file
  4 + active: dev