Browse Source

docker镜像使用自动生成的配置文件,修复#166

pull/174/head
648540858 3 years ago
parent
commit
715c7d2724
  1. 3
      DOCKERFILE
  2. 12
      src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java

3
DOCKERFILE

@ -68,6 +68,7 @@ RUN mkdir -p /opt/media && \
cd build && \ cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \ cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 && \ make -j4 && \
rm -rf ../release/linux/Release/config.ini && \
cp -r ../release/linux/Release/* /opt/media && \ cp -r ../release/linux/Release/* /opt/media && \
mkdir -p /opt/media/www/record 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 'nohup /opt/media/MediaServer -d -m 3 &' >> run.sh && \
echo 'cd /opt/wvp' >> run.sh && \ echo 'cd /opt/wvp' >> run.sh && \
echo 'if [${WVP_CONFIG}]; then' >> 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 '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 ' 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 echo 'fi' >> run.sh

12
src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java

@ -93,7 +93,11 @@ public class MediaConfig{
} }
public String getSipIp() { public String getSipIp() {
return sipIp; if (sipIp == null) {
return this.ip;
}else {
return sipIp;
}
} }
public int getHttpPort() { public int getHttpPort() {
@ -183,13 +187,13 @@ public class MediaConfig{
mediaServerItem.setIp(ip); mediaServerItem.setIp(ip);
mediaServerItem.setDefaultServer(true); mediaServerItem.setDefaultServer(true);
mediaServerItem.setHookIp(getHookIp()); mediaServerItem.setHookIp(getHookIp());
mediaServerItem.setSdpIp(sdpIp); mediaServerItem.setSdpIp(getSdpIp());
mediaServerItem.setStreamIp(streamIp); mediaServerItem.setStreamIp(getStreamIp());
mediaServerItem.setHttpPort(httpPort); mediaServerItem.setHttpPort(httpPort);
mediaServerItem.setHttpSSlPort(httpSSlPort); mediaServerItem.setHttpSSlPort(httpSSlPort);
mediaServerItem.setRtmpPort(rtmpPort); mediaServerItem.setRtmpPort(rtmpPort);
mediaServerItem.setRtmpSSlPort(rtmpSSlPort); mediaServerItem.setRtmpSSlPort(rtmpSSlPort);
mediaServerItem.setRtpProxyPort(rtpProxyPort); mediaServerItem.setRtpProxyPort(getRtpProxyPort());
mediaServerItem.setRtspPort(rtspPort); mediaServerItem.setRtspPort(rtspPort);
mediaServerItem.setRtspSSLPort(rtspSSLPort); mediaServerItem.setRtspSSLPort(rtspSSLPort);
mediaServerItem.setAutoConfig(autoConfig); mediaServerItem.setAutoConfig(autoConfig);

Loading…
Cancel
Save