- Install docker
- Install docker-compose
- domain
- certs for domain
- make sure that there is no nginx running
- clone the docker-apprtc project
git clone https://github.com/yunqiic/docker-apprtc.git
- change PUBLIC_IP to your public ip
PUBLIC_IP=127.0.0.1
- Change the url domain
- This project will use https and wss
ICE_SERVER_BASE_URL = 'https://yourdoamin.com'
WSS_INSTANCE_HOST_KEY: 'yourdoamin.com'
- 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;
- The
randomcalling
is the url path you want to visit, like https://yourdomain.dom/randomcalling - There are two
randomcalling
you need to update.
# 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;
}
- 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
- 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
sudo docker-compose up -d
# check the service
sudo docker-compose ps
# check the log
sudo docker-compose logs -f
- enjoy it by your url, like https://yourdomain.com. The url should be configured in the nginx.conf.
支付宝 | 微信 |