Browse Source

继续优化docker配置:

1.启动命令增加ASSIST_JVM_CONFIG和WVP_JVM_CONFIG两个字段,方便配置JVM参数
2.修复一处错误,application.yml media.stream-ip的值应该等于media.ip而不是之前的sip.ip
pull/259/head
xiaoxie 3 years ago
parent
commit
0984290ca2
  1. 2
      docker/docker-compose.yml
  2. 4
      docker/wvp/Dockerfile
  3. 6
      src/main/resources/application-docker.yml

2
docker/docker-compose.yml

@ -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:

4
docker/wvp/Dockerfile

@ -47,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 -Xms128m -Xmx256m -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 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 -Xms128m -Xmx256m -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 && \
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

6
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作为数据库,一般不需要配置
@ -67,7 +67,7 @@ media:
send-port-range: 30000,30500 # 端口范围
# 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用
record-assist-port: 18081
sdp-ip: ${sip.ip}
sdp-ip: ${media.ip}
stream-ip: ${sip.ip}
# [可选] 日志配置, 一般不需要改
logging:
@ -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