Browse Source

尝试docker-compose启动

pull/212/head
xiaoxie 3 years ago
parent
commit
fa54f00a9d
  1. 15
      docker/docker-compose.yml
  2. 12
      docker/wvp/Dockerfile
  3. 22
      src/main/resources/application-dev.yml
  4. 2
      src/main/resources/application.yml

15
docker/docker-compose.yml

@ -12,6 +12,9 @@ services:
wvp:
build:
context: ./wvp
args:
gitUrl: "https://gitee.com/xieyu1989"
zlmGitUrl: "https://gitee.com/xia-chu/ZLMediaKit"
restart: always
ports:
- "5060:5060"
@ -24,8 +27,20 @@ services:
- "30000-30500:30000-30500/udp"
volumes:
- ./video:/opt/media/www/record/
- ./logs/wvp:/opt/wvp/logs/
- ./logs/assist:/opt/assist/logs/
- ./logs/media:/opt/media/logs/
environment:
TZ: "Asia/Shanghai"
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PWD: root
WVP_DOMAIN: 6101130049
WVP_ID: 61011300490000000001
# [必须修改] 本机的IP
WVP_HOST: 172.18.0.61
WVP_PWD: aseqw_+hiy123
ASSIST_CONFIG:
WVP_CONFIG:
depends_on:
- redis

12
docker/wvp/Dockerfile

@ -1,16 +1,19 @@
FROM ubuntu:20.04 AS build
ARG gitUrl="https://gitee.com/18010473990"
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 && \
cd /home && \
git clone https://gitee.com/18010473990/maven.git && \
git clone ${gitUrl}/maven.git && \
cp maven/settings.xml /usr/share/maven/conf/ && \
git clone https://gitee.com/18010473990/wvp-GB28181.git && \
git clone https://gitee.com/18010473990/wvp-pro-assist.git && \
git clone --depth=1 https://gitee.com/xia-chu/ZLMediaKit && \
git clone ${gitUrl}/wvp-GB28181.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 && \
cd /home/wvp-GB28181/web_src && \
@ -63,6 +66,7 @@ EXPOSE 30000-30500/tcp
EXPOSE 30000-30500/udp
RUN export DEBIAN_FRONTEND=noninteractive &&\
export LANG=zh_CN.UTF-8
apt-get update && \
apt-get install -y --no-install-recommends openjdk-11-jre ca-certificates ffmpeg language-pack-zh-hans && \
apt-get autoremove -y && \

22
src/main/resources/application-dev.yml

@ -2,13 +2,13 @@ spring:
# REDIS数据库配置
redis:
# [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1
host: 127.0.0.1
host: ${REDIS_HOST:127.0.0.1}
# [必须修改] 端口号
port: 6379
port: ${REDIS_PORT:6379}
# [可选] 数据库 DB
database: 6
# [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接
password:
password: ${REDIS_PWD}
# [可选] 超时时间
timeout: 10000
# [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置
@ -36,18 +36,18 @@ server:
# 作为28181服务器的配置
sip:
# [必须修改] 本机的IP
ip: 192.168.0.100
ip: ${WVP_HOST}
# [可选] 28181服务监听的端口
port: 5060
# 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)
# 后两位为行业编码,定义参照附录D.3
# 3701020049标识山东济南历下区 信息行业接入
# [可选]
domain: 4401020049
domain: ${WVP_DOMAIN:4401020049}
# [可选]
id: 44010200492000000001
id: ${WVP_ID:44010200492000000001}
# [可选] 默认设备认证密码,后续扩展使用设备单独密码, 移除密码将不进行校验
password: admin123
password: ${WVP_PWD:admin123}
#zlm 默认服务器配置
media:
@ -66,8 +66,9 @@ media:
# [可选] 国标级联在此范围内选择端口发送媒体流,
send-port-range: 30000,30500 # 端口范围
# 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用
record-assist-port: 0
record-assist-port: 18081
sdp-ip: ${WVP_HOST}
stream-ip: ${WVP_HOST}
# [可选] 日志配置, 一般不需要改
logging:
file:
@ -84,6 +85,7 @@ logging:
user-settings:
# 推流直播是否录制
record-push-live: true
auto-apply-play: false
# 在线文档: swagger-ui(生产环境建议关闭)
swagger-ui:
@ -93,4 +95,4 @@ swagger-ui:
version:
version: "@project.version@"
description: "@project.description@"
artifact-id: "@project.artifactId@"
artifact-id: "@project.artifactId@"

2
src/main/resources/application.yml

@ -1,3 +1,3 @@
spring:
profiles:
active: local
active: dev

Loading…
Cancel
Save