diff --git a/.env.default b/.env.default index 9978964..a575b3f 100644 --- a/.env.default +++ b/.env.default @@ -34,9 +34,9 @@ SERVER_IP_INTERNAL='' # 必填, 服务器域名, 若没有域名, 则填写公网IP SERVER_HOSTNAME='' # livedvr.tripsdd.com -# 使用https时, 必填, 证书文件的绝对路径, 排除.crt/.key后缀, nginx实际读取的是 ${SSL_CERTIFICATE}.crt 和 ${SSL_CERTIFICATE}.key 两个文件 -# 如果暂时没有申请到证书, 可以使用内置的假证书: /home/docker/nginx/ssl/placeholder -# 若使用crotbot自动申请证书, 证书的路径会在日志中打印, 一般为: /data/certbot/live/${SERVER_HOSTNAME}/certificate +# 必填, 证书文件的绝对路径, 排除.crt/.key后缀, nginx实际读取的是 ${SSL_CERTIFICATE}.crt 和 ${SSL_CERTIFICATE}.key 两个文件 +# 如果使用http, 或者使用https但暂时没有申请到证书, 可以设置成内置的假证书: /home/docker/nginx/ssl/placeholder +# 若使用crotbot自动申请证书, 需要先单独启动一次(docker compose up crotbot), 申请到的证书路径会在日志中打印, 然后将它添加到变量中, 一般为: /data/certbot/live/${SERVER_HOSTNAME}/certificate, SSL_CERTIFICATE='' # /home/docker-compose/ssl/livedvr_tripsdd_com # bus和track部署在同一台服务器上时, 需要通过域名区分两者 diff --git a/README.md b/README.md index 649ae61..50f0387 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,10 @@ git clone https://github.com/TranscodeGroup/docker.git /home/docker **单机单独部署**: -- [bus-http](./examples/bus-http/compose.yaml): Bus-http单机部署 -- [bus-https](./examples/bus-https/compose.yaml): Bus-https单机部署 -- [track-https](./examples/track-https/compose.yaml): Tracker V2单机部署 +- [bus-http](./examples/bus-http/compose.yaml): Bus http单机部署 +- [bus-https](./examples/bus-https/compose.yaml): Bus https单机部署 +- [track-http](./examples/track-http/compose.yaml): Tracker V2 http单机部署 +- [track-https](./examples/track-https/compose.yaml): Tracker V2 https单机部署 **分布式部署**: diff --git a/bus/compose.yml b/bus/compose.yml index d16453a..36f1c25 100644 --- a/bus/compose.yml +++ b/bus/compose.yml @@ -1,7 +1,6 @@ services: gateway_808_2019: image: transcodegroup/gateway-808-2019:${BUS_GATEWAY_808_2019_VERSION:?required} - container_name: gateway_808_2019 restart: always volumes: - ${DATA_DIR:-/data}/files:/data/files @@ -54,7 +53,6 @@ services: # spring-boot后端 gateway_web: image: transcodegroup/gateway-web:${BUS_GATEWAY_VERSION:?required} - container_name: gateway_web restart: always volumes: - ${DATA_DIR:-/data}/files:/data/files @@ -105,7 +103,6 @@ services: # spring-boot调度 gateway_dispatch: image: transcodegroup/gateway-dispatch:${BUS_GATEWAY_VERSION:?required} - container_name: gateway_dispatch restart: always volumes: - ${DATA_DIR:-/data}/files:/data/files @@ -153,7 +150,6 @@ services: # 主动安全 gateway_jsatl12: image: transcodegroup/gateway-jsatl12:${BUS_GATEWAY_JSATL12_VERSION:?required} - container_name: gateway_jsatl12 restart: always ports: - ${JTT808_PORT_FILE}:${JTT808_PORT_FILE} diff --git a/examples/bus-http/.env b/examples/bus-http/.env index 3f0994c..8150f1a 100644 --- a/examples/bus-http/.env +++ b/examples/bus-http/.env @@ -3,6 +3,8 @@ SERVER_HOSTNAME='transcodegroup.cn' ## 公网IP SERVER_IP_PUBLIC='81.71.36.80' +# 即使不使用https, 也要配置一个占位证书 +SSL_CERTIFICATE=/home/docker/nginx/ssl/placeholder #---------自定义初始密码, 建议随机生成新的替换------------- ## MYSQL, 必填,示例: p92oVkNxrUttUUu8qyqs diff --git a/examples/bus-http/compose.yaml b/examples/bus-http/compose.yaml index dbc3d91..70d0f2e 100644 --- a/examples/bus-http/compose.yaml +++ b/examples/bus-http/compose.yaml @@ -5,9 +5,6 @@ include: - ../docker/rabbitmq/compose.yml - ../docker/redis/compose.yml - ../docker/bus/compose.yml - - path: - - ../docker/video-nginx/compose.yml - - ../docker/video-nginx/compose.http.yml - path: - ../docker/video/compose.yml - ../docker/video/compose.bus.yml @@ -15,7 +12,8 @@ include: - path: - ../docker/nginx/compose.yml - ../docker/nginx/compose.bus.yml - - ../docker/nginx/compose.bus.http.yml + - ../docker/nginx/compose.video.yml + - ../docker/nginx/compose.video.http.yml - path: - ../docker/web-downloader/compose.yml - ../docker/web-downloader/compose.bus.yml diff --git a/examples/bus-https/compose.yaml b/examples/bus-https/compose.yaml index cfcdcf8..e5061e0 100644 --- a/examples/bus-https/compose.yaml +++ b/examples/bus-https/compose.yaml @@ -6,7 +6,6 @@ include: - ../docker/rabbitmq/compose.yml - ../docker/redis/compose.yml - ../docker/bus/compose.yml - - ../docker/video-nginx/compose.yml - ../docker/certbot/compose.yml - path: - ../docker/video/compose.yml @@ -14,7 +13,7 @@ include: - path: - ../docker/nginx/compose.yml - ../docker/nginx/compose.bus.yml - - ../docker/nginx/compose.bus.https.yml + - ../docker/nginx/compose.video.yml - path: - - ../docker/web-downloader/compose.yml + - ../docker/web-downloader/compose.yml - ../docker/web-downloader/compose.bus.yml diff --git a/examples/bus-https/ssl/tg_com.crt b/examples/bus-https/ssl/tg_com.crt deleted file mode 100644 index bee34be..0000000 --- a/examples/bus-https/ssl/tg_com.crt +++ /dev/null @@ -1,66 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGcjCCBNqgAwIBAgIQVdh/VzIRn7qxxlnzQq2qFDANBgkqhkiG9w0BAQwFADBZ -MQswCQYDVQQGEwJDTjElMCMGA1UEChMcVHJ1c3RBc2lhIFRlY2hub2xvZ2llcywg -SW5jLjEjMCEGA1UEAxMaVHJ1c3RBc2lhIFJTQSBEViBUTFMgQ0EgRzIwHhcNMjQw -MjI2MDAwMDAwWhcNMjUwMzAxMjM1OTU5WjAfMR0wGwYDVQQDExR4bi50cmFuc2Nv -ZGVncm91cC5jbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALNSqy3f -dCHiZVEBqgEibsOPw6ZFCUSwYiSC4PIVHJ8RgT8LZ5KmXusFWy8PDzKCk9FrkCru -Pw9HV38k7X9QD4APPi0hr6hBQFfPaEaecILLEcGZbKblIt0SK2+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Y3NwLmNvbW9k -b2NhLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAHMUom5cxIje2IiFU7mOCsBr2F6CY -eU5cyfQ/Aep9kAXYUDuWsaT85721JxeXFYkf4D/cgNd9+hxT8ZeDOJrn+ysqR7NO -2K9AdqTdIY2uZPKmvgHOkvH2gQD6jc05eSPOwdY/10IPvmpgUKaGOa/tyygL8Og4 -3tYyoHipMMnS4OiYKakDJny0XVuchIP7ZMKiP07Q3FIuSS4omzR77kmc75/6Q9dP -v4wa90UCOn1j6r7WhMmX3eT3Gsdj3WMe9bYD0AFuqa6MDyjIeXq08mVGraXiw73s -Zale8OMckn/BU3O/3aFNLHLfET2H2hT6Wb3nwxjpLIfXmSVcVd8A58XH0g== ------END CERTIFICATE----- \ No newline at end of file diff --git a/examples/bus-https/ssl/tg_com.key b/examples/bus-https/ssl/tg_com.key deleted file mode 100644 index 543f91b..0000000 --- a/examples/bus-https/ssl/tg_com.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAs1KrLd90IeJlUQGqASJuw4/DpkUJRLBiJILg8hUcnxGBPwtn -kqZe6wVbLw8PMoKT0WuQKu4/D0dXfyTtf1APgA8+LSGvqEFAV89oRp5wgssRwZls -puUi3RIrb60tWmX9Xnjn23NRb1gCTV79U0evON4XcuMenXSJI10Ua/AUR4ONkjMC -m7CXNtMlz7F4RUzFsPvJOew5KAegg1xe50wrQdfb1rOGkmIvKNFTteE0fcI+5gVG -o3gz5DwmvMqEw0bL+TAzZdT0JYX4gg9psUDmbdgIgUzGDLGfJ7bNRcWG7iaMqiAi -lZALNd1knRpWPpHtLEcWfC7i3sFWx3v0G9ac4QIDAQABAoIBAATcjyT/e53GjkIf -tizxMskM/vwlP37T/FkqjjAp99xtJFCh/cUZSxX6j3ILablQFnNVQ/OSAXYn1Dyv -ctvifwUVBLXDBcjdOgIXbqeJeJnnKPxTbUFqEWOmcDSHIKVkgfW7d+e4bOMEow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DwcQug6ijk1Kot//Ho2Sww== ------END RSA PRIVATE KEY----- diff --git a/examples/track-http/.env b/examples/track-http/.env new file mode 100644 index 0000000..7b23182 --- /dev/null +++ b/examples/track-http/.env @@ -0,0 +1,12 @@ +SERVER_IP_PUBLIC='58.82.168.197' +SERVER_HOSTNAME='th-track.transcodegroup.cn' +# 即使不使用https, 也要配置一个占位证书 +SSL_CERTIFICATE=/home/docker/nginx/ssl/placeholder +WEB_PORT_HTTP=80 + +MYSQL_PASSWORD='12345678' +REDIS_PASSWORD='12345678' +MONGODB_PASSWORD='12345678' +RABBITMQ_PASSWORD='12345678' +MINIO_PASSWORD='12345678' +MAIL_PASSWORD='12345678' diff --git a/examples/track-http/compose.yaml b/examples/track-http/compose.yaml new file mode 100644 index 0000000..b8f7626 --- /dev/null +++ b/examples/track-http/compose.yaml @@ -0,0 +1,22 @@ +## V2单机部署方案, 使用http +include: + - ../docker/mysql8/compose.yml + - ../docker/mysql-backup/compose.maintain.yml + - ../docker/redis/compose.yml + - ../docker/mongodb/compose.yml + - ../docker/rabbitmq/compose.yml + - ../docker/minio/compose.yml + - ../docker/maintain/compose.yml + - ../docker/jtt808/compose.yml + - path: + - ../docker/video/compose.yml + - ../docker/video/compose.storage.yml + - ../docker/video/compose.http.yml + - path: + - ../docker/nginx/compose.yml + - ../docker/nginx/compose.track.yml + - ../docker/nginx/compose.video.yml + - ../docker/nginx/compose.video.http.yml + - path: + - ../docker/web-downloader/compose.yml + - ../docker/web-downloader/compose.track.yml diff --git a/examples/track-https/.env b/examples/track-https/.env index 5a19006..18fb87f 100644 --- a/examples/track-https/.env +++ b/examples/track-https/.env @@ -1,10 +1,12 @@ SERVER_HOSTNAME='vpn.transbustransportes.com.br' SERVER_IP_PUBLIC='200.155.137.26' -SSL_CERTIFICATE=/home/docker-compose/ssl/certificate +# 证书可以先设成placeholder, 保证compose启动起来, 申请到证书之后, 再改成实际的证书路径 +SSL_CERTIFICATE=/home/docker/nginx/ssl/placeholder +# SSL_CERTIFICATE=/home/docker-compose/ssl/certificate -MYSQL_PASSWORD='123456' -REDIS_PASSWORD='123456' -MONGODB_PASSWORD='123456' -RABBITMQ_PASSWORD='123456' -MINIO_PASSWORD='123456' -MAIL_PASSWORD='123456' +MYSQL_PASSWORD='12345678' +REDIS_PASSWORD='12345678' +MONGODB_PASSWORD='12345678' +RABBITMQ_PASSWORD='12345678' +MINIO_PASSWORD='12345678' +MAIL_PASSWORD='12345678' diff --git a/examples/track-https/compose.yaml b/examples/track-https/compose.yaml index fd9766c..e61b2cb 100644 --- a/examples/track-https/compose.yaml +++ b/examples/track-https/compose.yaml @@ -9,10 +9,11 @@ include: - ../docker/minio/compose.yml - ../docker/maintain/compose.yml - ../docker/jtt808/compose.yml + - ../docker/video/compose.yml - path: - ../docker/nginx/compose.yml - ../docker/nginx/compose.track.yml - - ../docker/nginx/compose.track.https.yml + - ../docker/nginx/compose.video.yml - path: - ../docker/web-downloader/compose.yml - ../docker/web-downloader/compose.track.yml diff --git a/examples/video-storage/.env b/examples/video-storage/.env index 221a11f..4927627 100644 --- a/examples/video-storage/.env +++ b/examples/video-storage/.env @@ -1,16 +1,16 @@ ## 视频服务器 -VIDEO_IP=58.82.168.181 -VIDEO_HOSTNAME=livedvr.tripsdd.com +SERVER_IP_PUBLIC=58.82.168.181 +SERVER_HOSTNAME=livedvr.tripsdd.com # 证书文件的绝对路径, 排除.crt/.key后缀, nginx使用的是 $VIDEO_SSL_CERTIFICATE.crt 和 $VIDEO_SSL_CERTIFICATE.key 两个文件 -VIDEO_SSL_CERTIFICATE=/home/docker-compose/ssl/livedvr_tripsdd_com +SSL_CERTIFICATE=/home/docker/nginx/ssl/placeholder ## 网关服务器 JTT808_HOST=103.20.204.149 # RABBITMQ -RABBITMQ_HOST=1111 # 58.82.168.181 +RABBITMQ_HOST=58.82.168.182 RABBITMQ_PORT=5672 -RABBITMQ_PASSWORD=111 # 123 +RABBITMQ_PASSWORD=123456 # MINIO -MINIO_PASSWORD=11 # xxxxxxxxxxxxxxxx \ No newline at end of file +MINIO_PASSWORD=123456 diff --git a/examples/video-storage/compose.yaml b/examples/video-storage/compose.yaml index 5287d07..f716144 100644 --- a/examples/video-storage/compose.yaml +++ b/examples/video-storage/compose.yaml @@ -9,5 +9,6 @@ include: - ../docker/video/compose.yml - ../docker/video/compose.storage.yml - path: - - ../docker/video-nginx/compose.yml - - ../docker/video-nginx/compose.minio.yml + - ../docker/nginx/compose.yml + - ../docker/nginx/compose.video.yml + - ../docker/nginx/compose.video-minio.yml diff --git a/examples/video-stream/.env b/examples/video-stream/.env index d2c87a7..98493b6 100644 --- a/examples/video-stream/.env +++ b/examples/video-stream/.env @@ -1,8 +1,8 @@ ## 视频服务器 -VIDEO_IP=58.82.168.181 -VIDEO_HOSTNAME=livedvr.tripsdd.com +SERVER_IP_PUBLIC=58.82.168.181 +SERVER_HOSTNAME=livedvr.tripsdd.com # 证书文件的绝对路径, 排除.crt/.key后缀, nginx使用的是 $VIDEO_SSL_CERTIFICATE.crt 和 $VIDEO_SSL_CERTIFICATE.key 两个文件 -VIDEO_SSL_CERTIFICATE=/home/docker-compose/ssl/livedvr_tripsdd_com +SSL_CERTIFICATE=/home/docker/nginx/ssl/placeholder ## 网关服务器 -JTT808_HOST=103.20.204.149 \ No newline at end of file +JTT808_HOST=103.20.204.149 diff --git a/examples/video-stream/compose.yaml b/examples/video-stream/compose.yaml index c4e75c3..4c8a60c 100644 --- a/examples/video-stream/compose.yaml +++ b/examples/video-stream/compose.yaml @@ -4,6 +4,8 @@ # 默认开放端口: 直播9000,录像9001,对接9002, 监听9003,广播9004,RTMP9005:1935(srs) # Nginx代理9085-9089: http-flv(srs:8080端口), wss(rtp:9006端口), 拦截mdvr和ws关键字 include: - - ../docker/video-nginx/compose.yml + - path: + - ../docker/nginx/compose.yml + - ../docker/nginx/compose.video.yml - path: - ../docker/video/compose.yml diff --git a/jtt808/compose.yml b/jtt808/compose.yml index 9bc272c..1e1f15b 100644 --- a/jtt808/compose.yml +++ b/jtt808/compose.yml @@ -1,7 +1,6 @@ services: jtt808: image: transcodegroup/jtt808-server:${TRACK_JTT808_VERSION:?required} - container_name: jtt808_server restart: always ports: - ${JTT808_PORT}:${JTT808_PORT} diff --git a/maintain/compose.yml b/maintain/compose.yml index 9bf64ba..ca234be 100644 --- a/maintain/compose.yml +++ b/maintain/compose.yml @@ -1,7 +1,6 @@ services: maintain: image: transcodegroup/maintain-server:${TRACK_MAINTAIN_VERSION:?required} - container_name: maintain restart: always volumes: - /etc/localtime:/etc/localtime diff --git a/minio/compose.yml b/minio/compose.yml index c04e764..15be58b 100644 --- a/minio/compose.yml +++ b/minio/compose.yml @@ -1,7 +1,6 @@ services: minio: image: minio/minio:RELEASE.2024-08-03T04-33-23Z - container_name: minio restart: always ports: # 原生端口是9000和9001, 规避RTP服务端口冲突, 所以-1000 diff --git a/mongodb/compose.yml b/mongodb/compose.yml index bebe1e4..c76ffba 100644 --- a/mongodb/compose.yml +++ b/mongodb/compose.yml @@ -1,6 +1,5 @@ services: mongodb: - container_name: mongodb image: mongo restart: always privileged: true diff --git a/mysql-backup/compose.cbus.yml b/mysql-backup/compose.cbus.yml index 257e2be..41b2a89 100644 --- a/mysql-backup/compose.cbus.yml +++ b/mysql-backup/compose.cbus.yml @@ -1,7 +1,6 @@ services: mysql-cron-backup-cbus: image: fradelg/mysql-cron-backup - container_name: mysql-cron-backup-cbus volumes: - "${DATA_DIR:-/data}/mysql8/backup:/backup" - /etc/localtime:/etc/localtime:ro diff --git a/mysql-backup/compose.maintain.yml b/mysql-backup/compose.maintain.yml index 72bf059..8ce1e8b 100644 --- a/mysql-backup/compose.maintain.yml +++ b/mysql-backup/compose.maintain.yml @@ -1,7 +1,6 @@ services: mysql-cron-backup-maintain: image: fradelg/mysql-cron-backup - container_name: mysql-cron-backup-maintain volumes: - "${DATA_DIR:-/data}/mysql8/backup:/backup" - /etc/localtime:/etc/localtime:ro diff --git a/mysql8/compose.yml b/mysql8/compose.yml index f670fda..54a5fe3 100644 --- a/mysql8/compose.yml +++ b/mysql8/compose.yml @@ -3,7 +3,6 @@ services: image: mysql:8.4 # 国内拦了 用加速站 #image: docker.m.daocloud.io/mysql:8.4 - container_name: mysql8 restart: always ports: - ${MYSQL_PORT:-3306}:3306 diff --git a/nginx/compose.bus.http.yml b/nginx/compose.bus.http.yml deleted file mode 100644 index f2e318d..0000000 --- a/nginx/compose.bus.http.yml +++ /dev/null @@ -1,6 +0,0 @@ -secrets: - # 因为http和https共用了一个nginx.conf文件, 即使不使用https, 也要配置该变量, 否则nginx会报错, 占位证书 - bus-ssl-certificate: - file: ./ssl/placeholder.crt - bus-ssl-certificate-key: - file: ./ssl/placeholder.key diff --git a/nginx/compose.bus.https.yml b/nginx/compose.bus.https.yml deleted file mode 100644 index 1896f09..0000000 --- a/nginx/compose.bus.https.yml +++ /dev/null @@ -1,5 +0,0 @@ -secrets: - bus-ssl-certificate: - file: ${BUS_SSL_CERTIFICATE:?required}.crt - bus-ssl-certificate-key: - file: ${BUS_SSL_CERTIFICATE:?required}.key \ No newline at end of file diff --git a/nginx/compose.bus.yml b/nginx/compose.bus.yml index 73d2596..bcd01db 100644 --- a/nginx/compose.bus.yml +++ b/nginx/compose.bus.yml @@ -1,5 +1,8 @@ services: nginx: + depends_on: + - gateway_web + - gateway_dispatch configs: - source: bus.conf.template target: /etc/nginx/templates/bus.conf.template diff --git a/nginx/compose.track.http.yml b/nginx/compose.track.http.yml deleted file mode 100644 index 8f79177..0000000 --- a/nginx/compose.track.http.yml +++ /dev/null @@ -1,6 +0,0 @@ -secrets: - # 因为http和https共用了一个nginx.conf文件, 即使不使用https, 也要配置该变量, 否则nginx会报错, 占位证书 - bus-ssl-certificate: - file: ./ssl/placeholder.crt - bus-ssl-certificate-key: - file: ./ssl/placeholder.key \ No newline at end of file diff --git a/nginx/compose.track.https.yml b/nginx/compose.track.https.yml deleted file mode 100644 index da9cd2b..0000000 --- a/nginx/compose.track.https.yml +++ /dev/null @@ -1,5 +0,0 @@ -secrets: - track-ssl-certificate: - file: ${TRACK_SSL_CERTIFICATE:?required}.crt - track-ssl-certificate-key: - file: ${TRACK_SSL_CERTIFICATE:?required}.key \ No newline at end of file diff --git a/nginx/compose.track.yml b/nginx/compose.track.yml index aa8ab5d..3843dbc 100644 --- a/nginx/compose.track.yml +++ b/nginx/compose.track.yml @@ -1,5 +1,8 @@ services: nginx: + depends_on: + - maintain + - minio configs: - source: track.conf.template target: /etc/nginx/templates/track.conf.template diff --git a/nginx/compose.video-minio.yml b/nginx/compose.video-minio.yml new file mode 100644 index 0000000..0b69ea0 --- /dev/null +++ b/nginx/compose.video-minio.yml @@ -0,0 +1,14 @@ +services: + nginx: + depends_on: + - minio + configs: + - source: video-minio.conf.template + target: /etc/nginx/templates/video-minio.conf.template + environment: + - MINIO_HOST=${MINIO_HOST} + - MINIO_PORT=${MINIO_PORT} + +configs: + video-minio.conf.template: + file: ./conf/conf.d/video-minio.conf.template diff --git a/nginx/compose.video.http.yml b/nginx/compose.video.http.yml new file mode 100644 index 0000000..3259790 --- /dev/null +++ b/nginx/compose.video.http.yml @@ -0,0 +1,10 @@ +services: + nginx: + configs: + # 使用http的配置覆盖 + - source: video-http.conf.template + target: /etc/nginx/templates/video.conf.template + +configs: + video-http.conf.template: + file: ./conf/conf.d/video-http.conf.template diff --git a/nginx/compose.video.yml b/nginx/compose.video.yml new file mode 100644 index 0000000..d3c99b5 --- /dev/null +++ b/nginx/compose.video.yml @@ -0,0 +1,37 @@ +services: + nginx: + ports: + # 视频直播,映射srs端口 + - ${VIDEO_PORT_HTTPS_0}:${VIDEO_PORT_HTTPS_0} + - ${VIDEO_PORT_HTTPS_1}:${VIDEO_PORT_HTTPS_1} + - ${VIDEO_PORT_HTTPS_2}:${VIDEO_PORT_HTTPS_2} + - ${VIDEO_PORT_HTTPS_3}:${VIDEO_PORT_HTTPS_3} + - ${VIDEO_PORT_HTTPS_4}:${VIDEO_PORT_HTTPS_4} + - ${VIDEO_PORT_HTTPS_5}:${VIDEO_PORT_HTTPS_5} + depends_on: + - srs + - rtp + secrets: + - video-ssl-certificate + - video-ssl-certificate-key + configs: + # 默认启动https的配置 + - source: video-https.conf.template + target: /etc/nginx/templates/video.conf.template + environment: + - VIDEO_PORT_HTTPS_0=${VIDEO_PORT_HTTPS_0} + - VIDEO_PORT_HTTPS_1=${VIDEO_PORT_HTTPS_1} + - VIDEO_PORT_HTTPS_2=${VIDEO_PORT_HTTPS_2} + - VIDEO_PORT_HTTPS_3=${VIDEO_PORT_HTTPS_3} + - VIDEO_PORT_HTTPS_4=${VIDEO_PORT_HTTPS_4} + - VIDEO_PORT_HTTPS_5=${VIDEO_PORT_HTTPS_5} + +secrets: + video-ssl-certificate: + file: ${VIDEO_SSL_CERTIFICATE:?required}.crt + video-ssl-certificate-key: + file: ${VIDEO_SSL_CERTIFICATE:?required}.key + +configs: + video-https.conf.template: + file: ./conf/conf.d/video-https.conf.template diff --git a/nginx/compose.yml b/nginx/compose.yml index 7d4ca18..41fa83e 100644 --- a/nginx/compose.yml +++ b/nginx/compose.yml @@ -1,7 +1,6 @@ services: nginx: image: nginx:1.27.4 - container_name: nginx restart: always ports: - ${WEB_PORT_HTTPS:-443}:443 diff --git a/video-nginx/conf/conf.d/mdvr-live-http.conf.template b/nginx/conf/conf.d/video-http.conf.template similarity index 100% rename from video-nginx/conf/conf.d/mdvr-live-http.conf.template rename to nginx/conf/conf.d/video-http.conf.template diff --git a/video-nginx/conf/conf.d/mdvr-live-https.conf.template b/nginx/conf/conf.d/video-https.conf.template similarity index 100% rename from video-nginx/conf/conf.d/mdvr-live-https.conf.template rename to nginx/conf/conf.d/video-https.conf.template diff --git a/video-nginx/conf/conf.d/443.conf.template b/nginx/conf/conf.d/video-minio.conf.template similarity index 100% rename from video-nginx/conf/conf.d/443.conf.template rename to nginx/conf/conf.d/video-minio.conf.template diff --git a/rabbitmq/compose.yml b/rabbitmq/compose.yml index 6177cad..87491a8 100644 --- a/rabbitmq/compose.yml +++ b/rabbitmq/compose.yml @@ -1,7 +1,6 @@ services: rabbitmq: image: rabbitmq:management - container_name: rabbitmq restart: always ports: # 加密的 AMQP 协议端口 diff --git a/redis/compose.yml b/redis/compose.yml index 51c40c7..a5d7531 100644 --- a/redis/compose.yml +++ b/redis/compose.yml @@ -1,7 +1,6 @@ services: redis: image: redis - container_name: redis restart: always # 启用持久化 增加密码 降低日志级别 限制数据库数量 command: --appendonly yes --requirepass "${REDIS_PASSWORD:?required}" --loglevel warning --databases 3 diff --git a/video-nginx/.env b/video-nginx/.env deleted file mode 120000 index 0ef0888..0000000 --- a/video-nginx/.env +++ /dev/null @@ -1 +0,0 @@ -../.env.default \ No newline at end of file diff --git a/video-nginx/compose.http.yml b/video-nginx/compose.http.yml deleted file mode 100644 index 87427fb..0000000 --- a/video-nginx/compose.http.yml +++ /dev/null @@ -1,10 +0,0 @@ -services: - video-nginx: - configs: - # 使用http的配置覆盖 - - source: mdvr-live-http.conf.template - target: /etc/nginx/templates/mdvr-live.conf.template - -configs: - mdvr-live-http.conf.template: - file: ./conf/conf.d/mdvr-live-http.conf.template diff --git a/video-nginx/compose.minio.yml b/video-nginx/compose.minio.yml deleted file mode 100644 index 534969d..0000000 --- a/video-nginx/compose.minio.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - video-nginx: - configs: - - source: 443.conf.template - target: /etc/nginx/templates/443.conf.template diff --git a/video-nginx/compose.yml b/video-nginx/compose.yml deleted file mode 100644 index 1a07b40..0000000 --- a/video-nginx/compose.yml +++ /dev/null @@ -1,56 +0,0 @@ -services: - video-nginx: - image: nginx:1.22.1 - container_name: video-nginx - restart: always - ports: - # 视频直播,映射srs端口 - - ${VIDEO_PORT_HTTPS_0}:${VIDEO_PORT_HTTPS_0} - - ${VIDEO_PORT_HTTPS_1}:${VIDEO_PORT_HTTPS_1} - - ${VIDEO_PORT_HTTPS_2}:${VIDEO_PORT_HTTPS_2} - - ${VIDEO_PORT_HTTPS_3}:${VIDEO_PORT_HTTPS_3} - - ${VIDEO_PORT_HTTPS_4}:${VIDEO_PORT_HTTPS_4} - - ${VIDEO_PORT_HTTPS_5}:${VIDEO_PORT_HTTPS_5} - privileged: true - depends_on: - - srs - - rtp - secrets: - - video-ssl-certificate - - video-ssl-certificate-key - volumes: - #- "${DOCKER_DIR:-/home/docker}/video-nginx/conf/nginx.conf:/etc/nginx/nginx.conf" - # 使用配置文件模板, 后缀需要是.conf.tempalte - # https://hub.docker.com/_/nginx#:~:text=Using%20environment%20variables - #- "${DOCKER_DIR:-/home/docker}/video-nginx/conf/conf.d:/etc/nginx/templates" - - "${DOCKER_DIR:-/home/docker}/video-nginx/html:/usr/share/nginx/html" - - "${DATA_DIR:-/data}/logs/video-nginx:/var/log/nginx" - configs: - - source: nginx.conf - target: /etc/nginx/nginx.conf - # 默认启动https的配置 - - source: mdvr-live-https.conf.template - target: /etc/nginx/templates/mdvr-live.conf.template - environment: - - MINIO_HOST=${MINIO_HOST} - - MINIO_PORT=${MINIO_PORT} - - VIDEO_PORT_HTTPS_0=${VIDEO_PORT_HTTPS_0} - - VIDEO_PORT_HTTPS_1=${VIDEO_PORT_HTTPS_1} - - VIDEO_PORT_HTTPS_2=${VIDEO_PORT_HTTPS_2} - - VIDEO_PORT_HTTPS_3=${VIDEO_PORT_HTTPS_3} - - VIDEO_PORT_HTTPS_4=${VIDEO_PORT_HTTPS_4} - - VIDEO_PORT_HTTPS_5=${VIDEO_PORT_HTTPS_5} - -secrets: - video-ssl-certificate: - file: ${VIDEO_SSL_CERTIFICATE:?required}.crt - video-ssl-certificate-key: - file: ${VIDEO_SSL_CERTIFICATE:?required}.key - -configs: - nginx.conf: - file: ./conf/nginx.conf - 443.conf.template: - file: ./conf/conf.d/443.conf.template - mdvr-live-https.conf.template: - file: ./conf/conf.d/mdvr-live-https.conf.template diff --git a/video-nginx/conf/nginx.conf b/video-nginx/conf/nginx.conf deleted file mode 100644 index d0812db..0000000 --- a/video-nginx/conf/nginx.conf +++ /dev/null @@ -1,67 +0,0 @@ -user nginx; -worker_processes auto; - -error_log /var/log/nginx/error.log notice; -pid /var/run/nginx.pid; - - -events { - worker_connections 1024; -} - - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - server_tokens off; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /var/log/nginx/access.log main; - - sendfile on; - #tcp_nopush on; - - keepalive_timeout 65; - - #gzip on; - - # 开启和关闭gzip模式 - gzip on; - - # gizp压缩起点,文件大于1k才进行压缩 - gzip_min_length 4k; - - # gzip 压缩级别,1-9,数字越大压缩的越好,也越占用CPU时间 - gzip_comp_level 5; - - # 进行压缩的文件类型。 - gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/xml text/javascript application/json; - - # nginx对于静态文件的处理模块,开启后会寻找以.gz结尾的文件,直接返回,不会占用cpu进行压缩,如果找不到则不进行压缩 - # gzip_static on|off - - # 是否在http header中添加Vary: Accept-Encoding,建议开启 - gzip_vary on; - - # 设置压缩所需要的缓冲区大小,以4k为单位,如果文件为7k则申请2*4k的缓冲区 - gzip_buffers 4 32k; - - # 设置gzip压缩针对的HTTP协议版本 - # gzip_http_version 1.1; - - # 设置反向代理的数据启用压缩 如果需要 - gzip_proxied any; - - client_max_body_size 100m; - - # websocket - map $http_upgrade $connection_upgrade { - default upgrade; - '' close; - } - include /etc/nginx/conf.d/*.conf; -} \ No newline at end of file diff --git a/video-nginx/html/50x.html b/video-nginx/html/50x.html deleted file mode 100644 index 1d1d109..0000000 --- a/video-nginx/html/50x.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Error - - - - -

An error occurred.

-

Sorry, the page you are looking for is currently unavailable.
- Please try again later.

-

If you are the system administrator of this resource then you should check - the error log for details.

-

Faithfully yours, nginx.

- - - \ No newline at end of file diff --git a/video-nginx/html/index.html b/video-nginx/html/index.html deleted file mode 100644 index b0d69dc..0000000 --- a/video-nginx/html/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Welcome to nginx! - - - - -

Welcome to nginx!

-

If you see this page, the nginx web server is successfully installed and - working. Further configuration is required.

- -

For online documentation and support please refer to - nginx.org.
- Commercial support is available at - nginx.com. -

- -

Thank you for using nginx.

- - - \ No newline at end of file diff --git a/video/compose.bus.https.yml b/video/compose.bus.https.yml deleted file mode 100644 index 1ce5f88..0000000 --- a/video/compose.bus.https.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - # rtp推流服务 - rtp: - environment: - # https方式, 供前端使用 - - gateway_srs_wan_http=https://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_1}/mdvr,https://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_2}/mdvr,https://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_3}/mdvr,https://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_4}/mdvr,https://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_5}/mdvr diff --git a/video/compose.http.yml b/video/compose.http.yml new file mode 100644 index 0000000..7442ff7 --- /dev/null +++ b/video/compose.http.yml @@ -0,0 +1,6 @@ +services: + # rtp推流服务 + rtp: + environment: + # 复写url成http协议 + - gateway_srs_wan_http=http://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_1}/mdvr,http://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_2}/mdvr,http://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_3}/mdvr,http://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_4}/mdvr,http://${VIDEO_HOSTNAME:?required}:${VIDEO_PORT_HTTPS_5}/mdvr diff --git a/video/compose.yml b/video/compose.yml index d826339..b059b30 100644 --- a/video/compose.yml +++ b/video/compose.yml @@ -1,7 +1,6 @@ services: srs: image: ossrs/srs:v6.0-a1 - container_name: srs restart: always ports: # rtmp端口(rtp和app使用) @@ -26,7 +25,6 @@ services: # rtp推流服务 rtp: image: transcodegroup/gateway-rtpserver:23.8.5 - container_name: rtp restart: always ports: # 终端-实时直播端口