From 715c7d27243f2f583f6958b39b278a7b0a2642c8 Mon Sep 17 00:00:00 2001 From: 648540858 <18010473990@163.com> Date: Sun, 26 Sep 2021 14:32:42 +0800 Subject: [PATCH] =?UTF-8?q?docker=E9=95=9C=E5=83=8F=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E7=9A=84=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D#166?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOCKERFILE | 3 ++- .../java/com/genersoft/iot/vmp/conf/MediaConfig.java | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/DOCKERFILE b/DOCKERFILE index a87279e4..e8b5ecf5 100644 --- a/DOCKERFILE +++ b/DOCKERFILE @@ -68,6 +68,7 @@ RUN mkdir -p /opt/media && \ cd build && \ cmake -DCMAKE_BUILD_TYPE=Release .. && \ make -j4 && \ + rm -rf ../release/linux/Release/config.ini && \ cp -r ../release/linux/Release/* /opt/media && \ mkdir -p /opt/media/www/record @@ -89,7 +90,7 @@ 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.sdp-ip=${WVP_IP} --sip.ip=${WVP_IP} --media.stream-ip=${WVP_IP}' >> run.sh && \ echo 'fi' >> run.sh diff --git a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java index e6083614..20339a92 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java @@ -93,7 +93,11 @@ public class MediaConfig{ } public String getSipIp() { - return sipIp; + if (sipIp == null) { + return this.ip; + }else { + return sipIp; + } } public int getHttpPort() { @@ -183,13 +187,13 @@ public class MediaConfig{ mediaServerItem.setIp(ip); mediaServerItem.setDefaultServer(true); mediaServerItem.setHookIp(getHookIp()); - mediaServerItem.setSdpIp(sdpIp); - mediaServerItem.setStreamIp(streamIp); + mediaServerItem.setSdpIp(getSdpIp()); + mediaServerItem.setStreamIp(getStreamIp()); mediaServerItem.setHttpPort(httpPort); mediaServerItem.setHttpSSlPort(httpSSlPort); mediaServerItem.setRtmpPort(rtmpPort); mediaServerItem.setRtmpSSlPort(rtmpSSlPort); - mediaServerItem.setRtpProxyPort(rtpProxyPort); + mediaServerItem.setRtpProxyPort(getRtpProxyPort()); mediaServerItem.setRtspPort(rtspPort); mediaServerItem.setRtspSSLPort(rtspSSLPort); mediaServerItem.setAutoConfig(autoConfig);