Git Product home page Git Product logo

docker-apprtc's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.