mirror of
https://github.com/tl-open-source/tl-rtc-file.git
synced 2025-10-04 15:12:48 +08:00
feat: docker suppose coturn image
feat: push to dockerhub shell update fix: docker-compose.yml bugs
This commit is contained in:
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.git
|
||||||
|
|
||||||
|
svr/node_modules/
|
||||||
|
|
||||||
|
client/packages/rtc-web/
|
||||||
|
|
||||||
|
docker/mysql/data/
|
@@ -2,53 +2,41 @@
|
|||||||
#########################
|
#########################
|
||||||
# 一键推送dockerhub的脚本
|
# 一键推送dockerhub的脚本
|
||||||
# @auther: iamtsm
|
# @auther: iamtsm
|
||||||
# @version: v1.0.0
|
# @version: v1.1.0
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
######################################## start ######################################
|
######################################## start ######################################
|
||||||
build_version=latest
|
latest_version=latest
|
||||||
hub_version=v10.3.4
|
|
||||||
|
|
||||||
######################################## build ######################################
|
######################################## build ######################################
|
||||||
## build by docker-compose-build-code.yml
|
## build by docker-compose-build-code.yml
|
||||||
docker-compose -f ../docker/docker-compose-build-code.yml build
|
docker-compose -f ../docker/docker-compose-build-code.yml build
|
||||||
|
|
||||||
######################################## tag ########################################
|
######################################## tag ########################################
|
||||||
# tag hub version
|
|
||||||
docker tag docker-api:$build_version iamtsm/tl-rtc-file-api:$hub_version
|
|
||||||
docker tag docker-socket:$build_version iamtsm/tl-rtc-file-socket:$hub_version
|
|
||||||
docker tag docker-mysql:$build_version iamtsm/tl-rtc-file-mysql:$hub_version
|
|
||||||
|
|
||||||
# tag latest version
|
# tag latest version
|
||||||
docker tag docker-api:$build_version iamtsm/tl-rtc-file-api:$build_version
|
docker tag docker-api:$latest_version iamtsm/tl-rtc-file-api:$latest_version
|
||||||
docker tag docker-socket:$build_version iamtsm/tl-rtc-file-socket:$build_version
|
docker tag docker-socket:$latest_version iamtsm/tl-rtc-file-socket:$latest_version
|
||||||
docker tag docker-mysql:$build_version iamtsm/tl-rtc-file-mysql:$build_version
|
docker tag docker-mysql:$latest_version iamtsm/tl-rtc-file-mysql:$latest_version
|
||||||
|
docker tag docker-coturn:$latest_version iamtsm/tl-rtc-file-coturn:$latest_version
|
||||||
|
|
||||||
######################################## push #######################################
|
######################################## push #######################################
|
||||||
# push hub version
|
|
||||||
docker push iamtsm/tl-rtc-file-api:$hub_version
|
|
||||||
docker push iamtsm/tl-rtc-file-socket:$hub_version
|
|
||||||
docker push iamtsm/tl-rtc-file-mysql:$hub_version
|
|
||||||
|
|
||||||
# push latest version
|
# push latest version
|
||||||
docker push iamtsm/tl-rtc-file-api:$build_version
|
docker push iamtsm/tl-rtc-file-api:$latest_version
|
||||||
docker push iamtsm/tl-rtc-file-socket:$build_version
|
docker push iamtsm/tl-rtc-file-socket:$latest_version
|
||||||
docker push iamtsm/tl-rtc-file-mysql:$build_version
|
docker push iamtsm/tl-rtc-file-mysql:$latest_version
|
||||||
|
docker push iamtsm/tl-rtc-file-coturn:$latest_version
|
||||||
|
|
||||||
######################################## del ########################################
|
######################################## del ########################################
|
||||||
## del build version
|
## del build version
|
||||||
docker rmi docker-api:$build_version
|
docker rmi docker-api:$latest_version
|
||||||
docker rmi docker-socket:$build_version
|
docker rmi docker-socket:$latest_version
|
||||||
docker rmi docker-mysql:$build_version
|
docker rmi docker-mysql:$latest_version
|
||||||
|
docker rmi docker-coturn:$latest_version
|
||||||
|
|
||||||
# # del tag build version
|
# # del tag build version
|
||||||
docker rmi iamtsm/tl-rtc-file-api:$build_version
|
docker rmi iamtsm/tl-rtc-file-api:$latest_version
|
||||||
docker rmi iamtsm/tl-rtc-file-socket:$build_version
|
docker rmi iamtsm/tl-rtc-file-socket:$latest_version
|
||||||
docker rmi iamtsm/tl-rtc-file-mysql:$build_version
|
docker rmi iamtsm/tl-rtc-file-mysql:$latest_version
|
||||||
|
docker rmi iamtsm/tl-rtc-file-coturn:$latest_version
|
||||||
# del tag hub version
|
|
||||||
docker rmi iamtsm/tl-rtc-file-api:$hub_version
|
|
||||||
docker rmi iamtsm/tl-rtc-file-socket:$hub_version
|
|
||||||
docker rmi iamtsm/tl-rtc-file-mysql:$hub_version
|
|
||||||
|
|
||||||
######################################## done #######################################
|
######################################## done #######################################
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#########################
|
#########################
|
||||||
# 提供一键部署docker的脚本
|
# 提供一键部署docker的脚本
|
||||||
# @auther: iamtsm
|
# @auther: iamtsm
|
||||||
# @version: v1.0.0
|
# @version: v1.1.0
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
# 检查Docker是否启动
|
# 检查Docker是否启动
|
||||||
@@ -38,25 +38,33 @@ export tl_rtc_file_db_open=true
|
|||||||
docker pull iamtsm/tl-rtc-file-api
|
docker pull iamtsm/tl-rtc-file-api
|
||||||
docker pull iamtsm/tl-rtc-file-socket
|
docker pull iamtsm/tl-rtc-file-socket
|
||||||
docker pull iamtsm/tl-rtc-file-mysql
|
docker pull iamtsm/tl-rtc-file-mysql
|
||||||
|
docker pull iamtsm/tl-rtc-file-coturn
|
||||||
|
|
||||||
if docker images | grep -q "iamtsm/tl-rtc-file-api"; then
|
if docker images | grep -q "iamtsm/tl-rtc-file-api"; then
|
||||||
echo "======> check image iamtsm/tl-rtc-file-api exists ok..."
|
echo "======> check image iamtsm/tl-rtc-file-api exists ok..."
|
||||||
else
|
else
|
||||||
echo "======> Image $image_name does not exist. Exiting."
|
echo "======> Image iamtsm/tl-rtc-file-api does not exist. Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if docker images | grep -q "iamtsm/tl-rtc-file-socket"; then
|
if docker images | grep -q "iamtsm/tl-rtc-file-socket"; then
|
||||||
echo "======> check image iamtsm/tl-rtc-file-socket exists ok..."
|
echo "======> check image iamtsm/tl-rtc-file-socket exists ok..."
|
||||||
else
|
else
|
||||||
echo "======> Image $image_name does not exist. Exiting."
|
echo "======> Image iamtsm/tl-rtc-file-socket does not exist. Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if docker images | grep -q "iamtsm/tl-rtc-file-mysql"; then
|
if docker images | grep -q "iamtsm/tl-rtc-file-mysql"; then
|
||||||
echo "======> check image iamtsm/tl-rtc-file-mysql exists ok..."
|
echo "======> check image iamtsm/tl-rtc-file-mysql exists ok..."
|
||||||
else
|
else
|
||||||
echo "Image $image_name does not exist. Exiting."
|
echo "Image iamtsm/tl-rtc-file-mysql does not exist. Exiting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if docker images | grep -q "iamtsm/tl-rtc-file-coturn"; then
|
||||||
|
echo "======> check image iamtsm/tl-rtc-file-coturn exists ok..."
|
||||||
|
else
|
||||||
|
echo "Image iamtsm/tl-rtc-file-coturn does not exist. Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -70,9 +78,22 @@ docker run \
|
|||||||
-e MYSQL_DATABASE=webchat \
|
-e MYSQL_DATABASE=webchat \
|
||||||
-e MYSQL_USER=tlrtcfile \
|
-e MYSQL_USER=tlrtcfile \
|
||||||
-e MYSQL_PASSWORD=tlrtcfile \
|
-e MYSQL_PASSWORD=tlrtcfile \
|
||||||
|
-v ./../docker/mysql/data/mysql.env:/tlrtcfile/docker/mysql/mysql.env \
|
||||||
|
-v ./../docker/mysql/data/db:/var/lib/mysql \
|
||||||
|
-v ./../docker/mysql/data/my.cnf:/etc/mysql/conf.d/my.cnf \
|
||||||
|
-v ./../docker/mysql/data/log:/var/log/mysql \
|
||||||
|
-v ./../docker/mysql/data/init.sql:/docker-entrypoint-initdb.d/init.sql \
|
||||||
--restart=always \
|
--restart=always \
|
||||||
-d iamtsm/tl-rtc-file-mysql
|
-d iamtsm/tl-rtc-file-mysql
|
||||||
|
|
||||||
|
# 启动coturn容器
|
||||||
|
docker run \
|
||||||
|
--name=coturn \
|
||||||
|
-p 3478:3478/udp \
|
||||||
|
-p 3478:3478/tcp \
|
||||||
|
-v ./../docker/coturn/turnserver-with-secret-user.conf:/etc/coturn/turnserver.conf \
|
||||||
|
-d iamtsm/tl-rtc-file-coturn
|
||||||
|
|
||||||
# 启动api容器
|
# 启动api容器
|
||||||
docker run \
|
docker run \
|
||||||
--name=api \
|
--name=api \
|
||||||
@@ -111,6 +132,7 @@ docker run \
|
|||||||
-e tl_rtc_file_notify_open \
|
-e tl_rtc_file_notify_open \
|
||||||
-e tl_rtc_file_notify_qiwei_normal \
|
-e tl_rtc_file_notify_qiwei_normal \
|
||||||
-e tl_rtc_file_notify_qiwei_error \
|
-e tl_rtc_file_notify_qiwei_error \
|
||||||
|
-v ../tlrtcfile.env:/tlrtcfile/tlrtcfile.env \
|
||||||
--link mysql \
|
--link mysql \
|
||||||
-d iamtsm/tl-rtc-file-api tlapi
|
-d iamtsm/tl-rtc-file-api tlapi
|
||||||
|
|
||||||
@@ -152,5 +174,6 @@ docker run \
|
|||||||
-e tl_rtc_file_notify_open \
|
-e tl_rtc_file_notify_open \
|
||||||
-e tl_rtc_file_notify_qiwei_normal \
|
-e tl_rtc_file_notify_qiwei_normal \
|
||||||
-e tl_rtc_file_notify_qiwei_error \
|
-e tl_rtc_file_notify_qiwei_error \
|
||||||
|
-v ../tlrtcfile.env:/tlrtcfile/tlrtcfile.env \
|
||||||
--link mysql \
|
--link mysql \
|
||||||
-d iamtsm/tl-rtc-file-socket tlsocket
|
-d iamtsm/tl-rtc-file-socket tlsocket
|
@@ -21,6 +21,7 @@ services:
|
|||||||
- mysql
|
- mysql
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
- coturn
|
||||||
volumes:
|
volumes:
|
||||||
- ./tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
- ./tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- ./tlrtcfile.env
|
- ./tlrtcfile.env
|
||||||
environment:
|
environment:
|
||||||
- tl_rtc_file_env_mode=http
|
- tl_rtc_file_env_mode=https
|
||||||
- tl_rtc_file_db_open=true
|
- tl_rtc_file_db_open=true
|
||||||
command:
|
command:
|
||||||
- tlapi
|
- tlapi
|
||||||
@@ -42,6 +43,7 @@ services:
|
|||||||
- mysql
|
- mysql
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
- coturn
|
||||||
volumes:
|
volumes:
|
||||||
- ./tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
- ./tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
||||||
|
|
||||||
@@ -63,11 +65,12 @@ services:
|
|||||||
- mysql
|
- mysql
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
- coturn
|
||||||
volumes:
|
volumes:
|
||||||
- ./tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
- ./tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
||||||
|
|
||||||
#https模式启动socket服务
|
#https模式启动socket服务
|
||||||
socket-htts:
|
socket-https:
|
||||||
profiles: ['https']
|
profiles: ['https']
|
||||||
container_name: socket
|
container_name: socket
|
||||||
image: iamtsm/tl-rtc-file-socket
|
image: iamtsm/tl-rtc-file-socket
|
||||||
@@ -84,6 +87,7 @@ services:
|
|||||||
- mysql
|
- mysql
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
- coturn
|
||||||
volumes:
|
volumes:
|
||||||
- ./tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
- ./tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
||||||
|
|
||||||
@@ -103,3 +107,16 @@ services:
|
|||||||
- ./docker/mysql/data/my.cnf:/etc/mysql/conf.d/my.cnf
|
- ./docker/mysql/data/my.cnf:/etc/mysql/conf.d/my.cnf
|
||||||
- ./docker/mysql/data/log:/var/log/mysql
|
- ./docker/mysql/data/log:/var/log/mysql
|
||||||
- ./docker/mysql/data/init.sql:/docker-entrypoint-initdb.d/init.sql
|
- ./docker/mysql/data/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
|
|
||||||
|
#coturn服务
|
||||||
|
coturn:
|
||||||
|
profiles: ['http','https']
|
||||||
|
container_name: coturn
|
||||||
|
image: iamtsm/tl-rtc-file-coturn
|
||||||
|
env_file:
|
||||||
|
- ./docker/coturn/coturn.env
|
||||||
|
ports:
|
||||||
|
- "3478:3478/udp"
|
||||||
|
- "3478:3478/tcp"
|
||||||
|
volumes:
|
||||||
|
- ./docker/coturn/turnserver-with-secret-user.conf:/etc/turnserver.conf
|
1
docker/coturn/Dockerfile
Normal file
1
docker/coturn/Dockerfile
Normal file
@@ -0,0 +1 @@
|
|||||||
|
FROM coturn/coturn
|
@@ -1 +1,5 @@
|
|||||||
#coturn env feature use
|
## coturn 配置
|
||||||
|
|
||||||
|
#自动检测外网ip和中转ip
|
||||||
|
# DETECT_EXTERNAL_IP=yes
|
||||||
|
# DETECT_RELAY_IP=yes
|
@@ -13,8 +13,8 @@ min-port=49152
|
|||||||
min-port=55000
|
min-port=55000
|
||||||
#cli密码
|
#cli密码
|
||||||
cli-password=qwerty
|
cli-password=qwerty
|
||||||
#后台运行
|
#后台运行-默认关闭 docker运行时需关闭, 自行部署时,可以开启
|
||||||
daemon
|
# daemon
|
||||||
#会话指纹
|
#会话指纹
|
||||||
fingerprint
|
fingerprint
|
||||||
#中等详细日志
|
#中等详细日志
|
||||||
|
@@ -13,8 +13,8 @@ min-port=49152
|
|||||||
min-port=55000
|
min-port=55000
|
||||||
#cli密码
|
#cli密码
|
||||||
cli-password=qwerty
|
cli-password=qwerty
|
||||||
#后台运行
|
#后台运行-默认关闭 docker运行时需关闭, 自行部署时,可以开启
|
||||||
daemon
|
# daemon
|
||||||
#会话指纹
|
#会话指纹
|
||||||
fingerprint
|
fingerprint
|
||||||
#中等详细日志
|
#中等详细日志
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
|
|
||||||
|
#api服务
|
||||||
api:
|
api:
|
||||||
container_name: api
|
container_name: api
|
||||||
build:
|
build:
|
||||||
@@ -19,9 +20,11 @@ services:
|
|||||||
- mysql
|
- mysql
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
- coturn
|
||||||
volumes:
|
volumes:
|
||||||
- ../tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
- ../tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
||||||
|
|
||||||
|
#socket服务
|
||||||
socket:
|
socket:
|
||||||
container_name: socket
|
container_name: socket
|
||||||
build:
|
build:
|
||||||
@@ -37,9 +40,11 @@ services:
|
|||||||
- mysql
|
- mysql
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
- coturn
|
||||||
volumes:
|
volumes:
|
||||||
- ../tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
- ../tlrtcfile.env:/tlrtcfile/tlrtcfile.env
|
||||||
|
|
||||||
|
#mysql服务
|
||||||
mysql:
|
mysql:
|
||||||
container_name: mysql
|
container_name: mysql
|
||||||
restart: always
|
restart: always
|
||||||
@@ -56,3 +61,17 @@ services:
|
|||||||
- ./mysql/data/my.cnf:/etc/mysql/conf.d/my.cnf
|
- ./mysql/data/my.cnf:/etc/mysql/conf.d/my.cnf
|
||||||
- ./mysql/data/log:/var/log/mysql
|
- ./mysql/data/log:/var/log/mysql
|
||||||
- ./mysql/data/init.sql:/docker-entrypoint-initdb.d/init.sql
|
- ./mysql/data/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
|
|
||||||
|
#coturn服务
|
||||||
|
coturn:
|
||||||
|
container_name: coturn
|
||||||
|
env_file:
|
||||||
|
- ./coturn/coturn.env
|
||||||
|
build:
|
||||||
|
context: ./coturn/
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
|
ports:
|
||||||
|
- "3478:3478/udp"
|
||||||
|
- "3478:3478/tcp"
|
||||||
|
volumes:
|
||||||
|
- ./coturn/turnserver-with-secret-user.conf:/etc/turnserver.conf
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "10.3.4",
|
"version": "10.3.5",
|
||||||
"ws": {
|
"ws": {
|
||||||
"port": "请到 http.env 或者 https.env中进行配置",
|
"port": "请到 http.env 或者 https.env中进行配置",
|
||||||
"host": "请到 http.env 或者 https.env中进行配置"
|
"host": "请到 http.env 或者 https.env中进行配置"
|
||||||
|
@@ -9,15 +9,15 @@ tl_rtc_file_ws_host=ws://127.0.0.1:8444
|
|||||||
|
|
||||||
#-----------------以下为webrtc相关配置-----------------#
|
#-----------------以下为webrtc相关配置-----------------#
|
||||||
## webrtc-stun中继服务地址
|
## webrtc-stun中继服务地址
|
||||||
tl_rtc_file_webrtc_stun_host=
|
tl_rtc_file_webrtc_stun_host=stun:127.0.0.1:3478
|
||||||
## webrtc-turn中继服务地址
|
## webrtc-turn中继服务地址
|
||||||
tl_rtc_file_webrtc_turn_host=
|
tl_rtc_file_webrtc_turn_host=turn:127.0.0.1:3478?transport=udp
|
||||||
## webrtc中继服务用户名
|
## webrtc中继服务用户名
|
||||||
tl_rtc_file_webrtc_turn_username=
|
tl_rtc_file_webrtc_turn_username=tlrtcfile
|
||||||
## webrtc中继服务密码
|
## webrtc中继服务密码
|
||||||
tl_rtc_file_webrtc_turn_credential=
|
tl_rtc_file_webrtc_turn_credential=tlrtcfile
|
||||||
## webrtc中继服务Secret
|
## webrtc中继服务Secret
|
||||||
tl_rtc_file_webrtc_turn_secret=
|
tl_rtc_file_webrtc_turn_secret=tlrtcfile
|
||||||
## webrtc中继服务帐号过期时间 (毫秒)
|
## webrtc中继服务帐号过期时间 (毫秒)
|
||||||
tl_rtc_file_webrtc_turn_expire=86400000
|
tl_rtc_file_webrtc_turn_expire=86400000
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user