Browse Source

Merge pull request #259 from hotcoffie/wvp-28181-2.0

1.适配新的gitee地址
pull/276/head
648540858 3 years ago
committed by GitHub
parent
commit
ffb0fcb907
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      DOCKERFILE
  2. 4
      docker/docker-compose.yml
  3. 33
      docker/wvp/Dockerfile
  4. 16
      src/main/resources/application-docker.yml

18
DOCKERFILE

@ -1,7 +1,5 @@
FROM ubuntu:20.04 AS build
# DEBIAN_FRONTEND这个环境变量,告知操作系统应该从哪儿获得用户输入。
# 如果设置为”noninteractive”,你就可以直接运行命令,而无需向用户请求输入(所有操作都是非交互式的)。
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
@ -32,23 +30,23 @@ WORKDIR /home
RUN git clone https://gitee.com/pan648540858/maven.git && \
cp maven/settings.xml /usr/share/maven/conf/ && \
git clone https://gitee.com/pan648540858/wvp-GB28181-pro.git && \
git clone https://gitee.com/pan648540858/wvp-GB28181.git && \
git clone https://gitee.com/pan648540858/wvp-pro-assist.git
# 编译前端界面
WORKDIR /home/wvp-GB28181-pro/web_src
WORKDIR /home/wvp-GB28181/web_src
RUN npm install && \
npm run build && \
mkdir -p /opt/wvp/config && \
mkdir -p /opt/assist/config && \
cp /home/wvp-GB28181-pro/src/main/resources/application-docker.yml /opt/wvp/config/application.yml && \
cp /home/wvp-GB28181/src/main/resources/application-dev.yml /opt/wvp/config/application.yml && \
cp /home/wvp-pro-assist/src/main/resources/application-dev.yml /opt/assist/config/application.yml
# wvp打包
WORKDIR /home/wvp-GB28181-pro
WORKDIR /home/wvp-GB28181
RUN mvn compile && \
mvn package && \
cp /home/wvp-GB28181-pro/target/wvp*.jar /opt/wvp/
cp /home/wvp-GB28181/target/wvp*.jar /opt/wvp/
# wvp 录像管理打包
WORKDIR /home/wvp-pro-assist
@ -72,7 +70,7 @@ RUN mkdir -p /opt/media && \
# 清理
RUN rm -rf /home/wiki && \
rm -rf /home/wvp-GB28181-pro && \
rm -rf /home/wvp-GB28181 && \
apt-get autoremove -y git maven nodejs npm && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*dic
@ -87,9 +85,9 @@ RUN echo '#!/bin/bash' > run.sh && \
echo 'nohup /opt/media/MediaServer -d -m 3 &' >> run.sh && \
echo 'cd /opt/wvp' >> run.sh && \
echo 'if [${WVP_CONFIG}]; then' >> run.sh && \
echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \
echo ' java -jar *.jar --spring.confi g.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \
echo 'else' >> run.sh && \
echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 --media.ip=127.0.0.1 --media.hook-ip=127.0.0.1 --media.sdp-ip=${WVP_IP} --sip.ip=${WVP_IP} --media.stream-ip=${WVP_IP}' >> run.sh && \
echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 --media.ip=127.0.0.1 --media.sdp-ip=${WVP_IP} --sip.ip=${WVP_IP} --media.stream-ip=${WVP_IP}' >> run.sh && \
echo 'fi' >> run.sh
RUN chmod +x run.sh

4
docker/docker-compose.yml

@ -13,7 +13,7 @@ services:
build:
context: ./wvp
args:
gitUrl: "https://gitee.com/xieyu1989"
gitUrl: "https://gitee.com/pan648540858"
zlmGitUrl: "https://gitee.com/xia-chu/ZLMediaKit"
restart: always
ports:
@ -41,6 +41,8 @@ services:
REDIS_PORT: 6379
REDIS_DB: 6
REDIS_PWD: root
ASSIST_JVM_CONFIG: -Xms128m -Xmx256m
WVP_JVM_CONFIG: -Xms128m -Xmx256m
ASSIST_CONFIG:
WVP_CONFIG:
depends_on:

33
docker/wvp/Dockerfile

@ -1,4 +1,4 @@
FROM ubuntu:20.04 AS build
FROM ubuntu:20.04 as build
ARG gitUrl="https://gitee.com/pan648540858"
ARG zlmGitUrl="https://gitee.com/xia-chu/ZLMediaKit"
@ -6,30 +6,33 @@ ARG zlmGitUrl="https://gitee.com/xia-chu/ZLMediaKit"
RUN export DEBIAN_FRONTEND=noninteractive &&\
apt-get update && \
apt-get install -y --no-install-recommends openjdk-11-jre git maven nodejs npm build-essential \
cmake ca-certificates openssl ffmpeg
cmake ca-certificates openssl ffmpeg &&\
mkdir -p /opt/wvp/config /opt/wvp/heapdump /opt/wvp/config /opt/assist/config /opt/assist/heapdump /opt/media/www/record
RUN cd /home && \
git clone "https://gitee.com/pan648540858/maven.git" && \
cp maven/settings.xml /usr/share/maven/conf/ && \
git clone "${gitUrl}/wvp-GB28181-pro.git" && \
git clone "${gitUrl}/wvp-pro-assist.git" && \
git clone --depth=1 "${zlmGitUrl}" && \
mkdir -p /opt/wvp/config /opt/assist/config /opt/media/www/record
git clone "${gitUrl}/maven.git" && \
cp maven/settings.xml /usr/share/maven/conf/
RUN cd /home/wvp-GB28181/web_src && \
RUN cd /home && \
git clone "${gitUrl}/wvp-GB28181-pro.git"
RUN cd /home/wvp-GB28181-pro/web_src && \
npm install && \
npm run build
RUN cd /home/wvp-GB28181 && \
RUN cd /home/wvp-GB28181-pro && \
mvn clean package -Dmaven.test.skip=true && \
cp /home/wvp-GB28181/target/*.jar /opt/wvp/ && \
cp /home/wvp-GB28181/src/main/resources/application-docker.yml /opt/wvp/config/application.yml
cp /home/wvp-GB28181-pro/target/*.jar /opt/wvp/ && \
cp /home/wvp-GB28181-pro/src/main/resources/application-docker.yml /opt/wvp/config/application.yml
RUN cd /home && \
git clone "${gitUrl}/wvp-pro-assist.git"
RUN cd /home/wvp-pro-assist && \
git reset --hard 58f1a79136a55a7cd1593c95b56ddadcc2225b61 && \
mvn clean package -Dmaven.test.skip=true && \
cp /home/wvp-pro-assist/target/*.jar /opt/assist/ && \
cp /home/wvp-pro-assist/src/main/resources/application-dev.yml /opt/assist/config/application.yml
RUN cd /home && \
git clone --depth=1 "${zlmGitUrl}"
RUN cd /home/ZLMediaKit && \
git submodule update --init --recursive && \
mkdir -p build release/linux/Release/ &&\
@ -44,10 +47,10 @@ RUN cd /opt/wvp && \
echo 'echo ${WVP_IP}' >> run.sh && \
echo 'echo ${WVP_CONFIG}' >> run.sh && \
echo 'cd /opt/assist' >> run.sh && \
echo 'nohup java -jar *.jar --spring.config.location=/opt/assist/config/application.yml --userSettings.record=/opt/media/www/record/ --media.record-assist-port=18081 ${ASSIST_CONFIG} &' >> run.sh && \
echo 'nohup java ${ASSIST_JVM_CONFIG} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/assist/heapdump/ -jar *.jar --spring.config.location=/opt/assist/config/application.yml --userSettings.record=/opt/media/www/record/ --media.record-assist-port=18081 ${ASSIST_CONFIG} &' >> run.sh && \
echo 'nohup /opt/media/MediaServer -d -m 3 &' >> run.sh && \
echo 'cd /opt/wvp' >> run.sh && \
echo 'java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \
echo 'java ${WVP_JVM_CONFIG} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/wvp/heapdump/ -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \
chmod +x run.sh
FROM ubuntu:20.04

16
src/main/resources/application-docker.yml

@ -8,7 +8,7 @@ spring:
# [可选] 数据库 DB
database: ${REDIS_DB:6}
# [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接
password: ${REDIS_PWD:}
password: ${REDIS_PWD:root}
# [可选] 超时时间
timeout: 10000
# [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置
@ -36,9 +36,9 @@ server:
# 作为28181服务器的配置
sip:
# [必须修改] 本机的IP
ip: ${WVP_HOST}
ip: ${WVP_HOST:127.0.0.1}
# [可选] 28181服务监听的端口
port: 5060
port: ${WVP_PORT:5060}
# 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)
# 后两位为行业编码,定义参照附录D.3
# 3701020049标识山东济南历下区 信息行业接入
@ -52,9 +52,9 @@ sip:
#zlm 默认服务器配置
media:
# [必须修改] zlm服务器的内网IP
ip: 127.0.0.1
ip: ${ZLM_HOST:127.0.0.1}
# [必须修改] zlm服务器的http.port
http-port: 80
http-port: ${ZLM_PORT:80}
# [可选] zlm服务器的hook.admin_params=secret
secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc
# 启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试
@ -67,8 +67,8 @@ media:
send-port-range: 30000,30500 # 端口范围
# 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用
record-assist-port: 18081
sdp-ip: ${WVP_HOST}
stream-ip: ${WVP_HOST}
sdp-ip: ${sip.ip}
stream-ip: ${sip.ip}
# [可选] 日志配置, 一般不需要改
logging:
file:
@ -85,7 +85,7 @@ logging:
user-settings:
# 推流直播是否录制
record-push-live: true
auto-apply-play: false
auto-apply-play: true
# 在线文档: swagger-ui(生产环境建议关闭)
swagger-ui:

Loading…
Cancel
Save