├── .github └── workflows │ ├── prod-docker-image-arm64-buildjet.yml │ ├── prod-docker-image.yml │ └── test-docker-image.yml ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── build.sh ├── nginx.conf └── push.sh /.github/workflows/prod-docker-image-arm64-buildjet.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI Prod arm64 depend on buildjet 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | logLevel: 7 | description: 'Log level' 8 | required: true 9 | default: 'info' 10 | type: choice 11 | options: 12 | - info 13 | - warning 14 | - debug 15 | 16 | jobs: 17 | 18 | build: 19 | 20 | runs-on: buildjet-4vcpu-ubuntu-2204-arm 21 | 22 | steps: 23 | - uses: actions/checkout@v3 24 | - name: Set Global Variables 25 | run: echo "version=1.3.1-arm64" >> $GITHUB_ENV 26 | - name: Build the Docker image 27 | run: docker build . --file Dockerfile --tag sucwangsr/janus-webrtc-gateway-docker:$version 28 | - name: push hub 29 | run: docker login -u ${{secrets.HUB_USER}} -p ${{secrets.HUB_PWD}} && docker push sucwangsr/janus-webrtc-gateway-docker:$version && docker logout 30 | -------------------------------------------------------------------------------- /.github/workflows/prod-docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI Prod 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | logLevel: 7 | description: 'Log level' 8 | required: true 9 | default: 'info' 10 | type: choice 11 | options: 12 | - info 13 | - warning 14 | - debug 15 | 16 | jobs: 17 | 18 | build: 19 | 20 | runs-on: ubuntu-latest 21 | 22 | steps: 23 | - uses: actions/checkout@v3 24 | - name: Set Global Variables 25 | run: echo "version=1.3.1-slim" >> $GITHUB_ENV 26 | - name: Build the Docker image 27 | run: docker build . --file Dockerfile --tag sucwangsr/janus-webrtc-gateway-docker:$version 28 | - name: push hub 29 | run: docker login -u ${{secrets.HUB_USER}} -p ${{secrets.HUB_PWD}} && docker push sucwangsr/janus-webrtc-gateway-docker:$version && docker logout 30 | -------------------------------------------------------------------------------- /.github/workflows/test-docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI Test 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | logLevel: 7 | description: 'Log level' 8 | required: true 9 | default: 'info' 10 | type: choice 11 | options: 12 | - info 13 | - warning 14 | - debug 15 | 16 | jobs: 17 | 18 | build: 19 | 20 | runs-on: ubuntu-latest 21 | 22 | steps: 23 | - uses: actions/checkout@v3 24 | - name: Set Global Variables 25 | run: echo "version=1.2.1-slim" >> $GITHUB_ENV 26 | - name: Build the Docker image 27 | run: docker build . --file Dockerfile --tag sucwangsr/janus-webrtc-gateway-docker:$version 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/janus-webrtc-gateway-docker.iml 2 | /.idea/modules.xml 3 | /.idea/vcs.xml 4 | /.idea/ 5 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | ENV DEBIAN_FRONTEND noninteractive 4 | RUN rm -rf /var/lib/apt/lists/* 5 | RUN apt-get -y update && apt-get install -y \ 6 | libjansson-dev \ 7 | libnice-dev \ 8 | libssl-dev \ 9 | libsofia-sip-ua-dev \ 10 | libglib2.0-dev \ 11 | zlib1g-dev \ 12 | libopus-dev \ 13 | libspeexdsp-dev \ 14 | libogg-dev \ 15 | libcurl4-openssl-dev \ 16 | libini-config-dev \ 17 | libcollection-dev \ 18 | libconfig-dev \ 19 | pkg-config \ 20 | gengetopt \ 21 | libtool \ 22 | autopoint \ 23 | automake \ 24 | build-essential \ 25 | subversion \ 26 | git \ 27 | cmake \ 28 | unzip \ 29 | zip \ 30 | g++ \ 31 | gcc \ 32 | libc6-dev \ 33 | make \ 34 | pkg-config \ 35 | lsof wget vim sudo rsync cron mysql-client openssh-server supervisor locate mplayer valgrind certbot curl dnsutils tcpdump gstreamer1.0-tools 36 | 37 | 38 | 39 | # libwebsockets 40 | RUN cd /tmp/ && LIBWEBSOCKET="4.3.2" && wget https://github.com/warmcat/libwebsockets/archive/v$LIBWEBSOCKET.tar.gz && \ 41 | tar xzvf v$LIBWEBSOCKET.tar.gz && \ 42 | cd libwebsockets-$LIBWEBSOCKET && \ 43 | mkdir build && \ 44 | cd build && \ 45 | cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" -DLWS_MAX_SMP=1 -DLWS_IPV6="ON" .. && \ 46 | make && make install 47 | 48 | # libsrtp 49 | RUN cd /tmp/ && SRTP="2.6.0" && wget https://github.com/cisco/libsrtp/archive/v$SRTP.tar.gz && \ 50 | tar xfv v$SRTP.tar.gz && \ 51 | cd libsrtp-$SRTP && \ 52 | ./configure --prefix=/usr --enable-openssl && \ 53 | make shared_library && sudo make install 54 | 55 | 56 | 57 | # libnice 0.1.21 commit 3d9cae16a5094aadb1651572644cb5786a8b4e2d 58 | RUN cd / && apt-get remove -y libnice-dev libnice10 && apt-get update -y && apt-get install -y python3-pip ninja-build && pip3 install meson && \ 59 | git clone https://gitlab.freedesktop.org/libnice/libnice.git && \ 60 | cd libnice && \ 61 | git checkout 3d9cae16a5094aadb1651572644cb5786a8b4e2d && \ 62 | meson --prefix=/usr build && \ 63 | ninja -C build && \ 64 | sudo ninja -C build install 65 | 66 | 67 | # datachannel build 68 | RUN cd / && git clone https://github.com/sctplab/usrsctp && \ 69 | cd usrsctp && \ 70 | ./bootstrap && \ 71 | ./configure --prefix=/usr --disable-programs --disable-inet --disable-inet6 && \ 72 | make && sudo make install 73 | 74 | # libmicrohttpd v0.9.72 75 | RUN apt-get update && apt-get install -y autoconf texinfo automake && \ 76 | cd /tmp && git clone https://git.gnunet.org/libmicrohttpd.git && \ 77 | cd libmicrohttpd && git checkout v0.9.72 && autoreconf -fi && \ 78 | ./configure --prefix=/usr --enable-messages --enable-https && make && make install 79 | 80 | 81 | # lua for plugin Lua 82 | RUN curl -L -R -O https://www.lua.org/ftp/lua-5.4.6.tar.gz \ 83 | && tar zxf lua-5.4.6.tar.gz \ 84 | && cd lua-5.4.6 \ 85 | && make all test \ 86 | && make install \ 87 | && lua -v 88 | 89 | # for duktape plugin 90 | RUN cd /tmp/ && curl -R -O https://duktape.org/duktape-2.7.0.tar.xz \ 91 | && tar xf duktape-2.7.0.tar.xz \ 92 | && mv duktape-2.7.0 / && cd /duktape-2.7.0 \ 93 | && make -f Makefile.cmdline \ 94 | && ln -s /duktape-2.7.0/duk /usr/local/bin/duk \ 95 | && duk 96 | 97 | 98 | 99 | ## janus if build use --enable-post-processing 100 | RUN apt-get update -y && apt-get install libavutil56 libavcodec58 libavformat58 libavutil-dev libavcodec-dev libavformat-dev -y 101 | 102 | 103 | # janus 104 | RUN cd / && git clone https://github.com/meetecho/janus-gateway.git && cd /janus-gateway && \ 105 | git checkout refs/tags/v1.3.1 && \ 106 | sh autogen.sh && \ 107 | ./configure --prefix=/usr/local \ 108 | --enable-post-processing \ 109 | --disable-rabbitmq \ 110 | --disable-mqtt \ 111 | --disable-unix-sockets \ 112 | --enable-all-handlers && \ 113 | make && make install && make configs 114 | 115 | 116 | #FFmpeg install 117 | RUN apt update -y && sudo apt install -y ffmpeg && ffmpeg -version 118 | 119 | # nginx 120 | RUN apt-get update -y && apt-get install -y nginx 121 | COPY nginx.conf /etc/nginx/nginx.conf 122 | 123 | RUN apt-get clean && \ 124 | rm -rf /var/lib/apt/lists/* 125 | 126 | SHELL ["/bin/bash", "-l", "-euxo", "pipefail", "-c"] 127 | 128 | CMD nginx && janus 129 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 suke|苏克 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # janus-webrtc-gateway-docker 3 | [![build docker images - janus-webrtc-docker](https://github.com/wangsrGit119/janus-webrtc-gateway-docker/actions/workflows/prod-docker-image.yml/badge.svg)](https://github.com/wangsrGit119/janus-webrtc-gateway-docker/actions/workflows/prod-docker-image.yml) 4 | 5 | > **Warning** 6 | >- if you want to use Janus 0.x please visit this repo [janus-webrtc-gateway-docker-0.x](https://github.com/atyenoria/janus-webrtc-gateway-docker) 7 | 8 | ## janus officia repository 9 | 10 | [The official janus repository](https://github.com/meetecho/janus-gateway.git "janus:1.0") 11 | 12 | >New version release depends on GitHub Action 13 | 14 | ## Base 15 | 16 | modify :point_down: repo, and update janus version , delete nginx-rtmp-module 17 | > https://github.com/atyenoria/janus-webrtc-gateway-docker 18 | > 19 | 20 | ## amd image version 21 | 22 | | janus-webrtc-gateway-docker Version | Janus Version |Desc| 23 | | ------------ | ------------ |------------ | 24 | | 1.2.0-slim | 1.2.0 | | 25 | | 1.2.1-slim | 1.2.1 | | 26 | | 1.2.2-slim | 1.2.2 | | 27 | | 1.2.3-slim | 1.2.3 | | 28 | | 1.2.4-slim | 1.2.4 | | 29 | | 1.3.0-slim | 1.3.0 | | 30 | | 1.3.1-slim | 1.3.1 | | 31 | ## arm64 images version 32 | 33 | | janus-webrtc-docker:version | janus:version | 34 | | ------------ | ------------ | 35 | | 1.2.0-arm64 | 1.2.0 | 36 | | 1.2.1-arm64 | 1.2.1 | 37 | | 1.2.2-arm64 | 1.2.2 | 38 | | 1.2.3-arm64 | 1.2.3 | 39 | | 1.2.4-arm64 | 1.2.4 | 40 | | 1.3.0-arm64 | 1.3.0 | 41 | | 1.3.1-arm64 | 1.3.1 | 42 | ## How to use 43 | 44 | - mkdir conf ---- configs from [https://github.com/meetecho/janus-gateway/tree/master/conf](https://github.com/meetecho/janus-gateway/tree/master/conf) 45 | - touch docker-compose.yml --- content eg::point_down: 46 | 47 | ```yaml 48 | version: '3.3' 49 | services: 50 | 51 | # 52 | # janus-gateway 53 | # 54 | janus-gateway: 55 | image: 'sucwangsr/janus-webrtc-gateway-docker:1.3.1-slim' 56 | #command: ["/usr/local/bin/janus", "-F", "/usr/local/etc/janus"] # only start janus 57 | command: ["sh", "-c", "nginx && /usr/local/bin/janus -F /usr/local/etc/janus"] # if want to start nginx (port 8086) 58 | network_mode: "host" 59 | 60 | volumes: 61 | - "./conf/janus.transport.http.jcfg:/usr/local/etc/janus/janus.transport.http.jcfg" # open adminapi config 62 | - "./conf/janus.jcfg:/usr/local/etc/janus/janus.jcfg" 63 | - "./conf/janus.eventhandler.sampleevh.jcfg:/usr/local/etc/janus/janus.eventhandler.sampleevh.jcfg" 64 | restart: always 65 | 66 | ``` 67 | 68 | >**Warning** 69 | > Before startup, please ensure your config files is ok, pay attention to comments in YAML 70 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | version=`date +%Y%m%d` 4 | 5 | echo "build time $version , build version $version" 6 | docker rmi $version 7 | docker build -t sucwangsr/janus-webrtc-gateway-docker:$version . 8 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | 2 | #user nobody; 3 | worker_processes 1; 4 | 5 | #error_log logs/error.log; 6 | #error_log logs/error.log notice; 7 | #error_log logs/error.log info; 8 | #pid logs/nginx.pid; 9 | 10 | events { 11 | worker_connections 1024; 12 | } 13 | 14 | 15 | http { 16 | include mime.types; 17 | default_type application/octet-stream; 18 | 19 | #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 20 | # '$status $body_bytes_sent "$http_referer" ' 21 | # '"$http_user_agent" "$http_x_forwarded_for"'; 22 | 23 | #access_log logs/access.log main; 24 | 25 | sendfile on; 26 | #tcp_nopush on; 27 | 28 | #keepalive_timeout 0; 29 | keepalive_timeout 65; 30 | 31 | #gzip on; 32 | 33 | server { 34 | listen 8086; 35 | server_name localhost; 36 | 37 | #charset koi8-r; 38 | 39 | #access_log logs/host.access.log main; 40 | 41 | location / { 42 | root /usr/local/share/janus/html/; 43 | index index.html index.htm; 44 | } 45 | 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | version=`date +%Y%m%d` 4 | 5 | echo "push time $version , push version $version" 6 | docker login -u $1 -p $2 7 | docker push sucwangsr/janus-webrtc-gateway-docker:$version 8 | docker logout 9 | --------------------------------------------------------------------------------