Skip to content

Latest commit

 

History

History
145 lines (112 loc) · 3.55 KB

README.md

File metadata and controls

145 lines (112 loc) · 3.55 KB

docker-apprtc

Table of Contents


Prepare

  1. Install docker
  2. Install docker-compose
  3. domain
  4. certs for domain
  5. make sure that there is no nginx running

Get Template Project

  • clone the docker-apprtc project
git clone https://github.com/yunqiic/docker-apprtc.git

Change Config

.env

  • change PUBLIC_IP to your public ip
PUBLIC_IP=127.0.0.1

constants.py in config dir

  • Change the url domain
  • This project will use https and wss
ICE_SERVER_BASE_URL = 'https://yourdoamin.com'
WSS_INSTANCE_HOST_KEY: 'yourdoamin.com'

nginx.conf in nginx-conf dir

  • change the server_name to your domain
  • You can update the ssl_certificate config if you like, but you should make sure that you have the file. You can check the file path in docker-compose.yml
  • The path in nginx.conf should be the container path, not the host path.
ssl_certificate /cert/fullchain.pem;
ssl_certificate_key /cert/privkey.pem;

server_name yourdomain.com www.yourdomain.com;
# https://yourdomain.dom/randomcalling
location /randomcalling {
    # 转向代理的地址
    proxy_pass http://roomserver;
    proxy_redirect    off;
    proxy_set_header Host $host;
    rewrite ^/randomcalling(.*) /$1 break;
}

# https://yourdomain.dom/randomcalling1
location /randomcalling1 {
    # 转向代理的地址
    proxy_pass http://roomserver;
    proxy_redirect    off;
    proxy_set_header Host $host;
    rewrite ^/randomcalling1(.*) /$1 break;
}

docker-compose.yml

  • change the volumns config /cert/yourdomain.com:/cert. The path /cert/yourdomain.com and certs file should exist in your host machine, and the certs file'name should be as the same as ssl_certificate, ssl_certificate_key config in the nginx.conf
  • /cert/yourdomain.com is the host path
volumes:
    - /cert/yourdomain.com:/cert # see ssl_certificate, ssl_certificate_key config in nginx.conf under nginx-conf dir. make sure you have the file

example

  • If you change the /cert behind :, you need to change the nginx.conf too.
  • make sure the host path /etc/letsencrypt/yourdomain.com is not the symbolic links
volumes:
    - /etc/letsencrypt/yourdomain.com:/cert # see ssl_certificate, ssl_certificate_key config in nginx.conf under nginx-conf dir. make sure you have the file

Start

sudo docker-compose up -d

# check the service
sudo docker-compose ps

# check the log
sudo docker-compose logs -f

Enjoy


Donate

支付宝 微信

Paypal