diff --git a/openvidu-server/docker/openvidu-coturn/Dockerfile b/openvidu-server/docker/openvidu-coturn/Dockerfile new file mode 100644 index 00000000..eac904ec --- /dev/null +++ b/openvidu-server/docker/openvidu-coturn/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:16.04 + +RUN apt-get update \ + && apt-get install -y coturn curl + +COPY ./configuration-files.sh /tmp/ +COPY ./entrypoint.sh /usr/local/bin + +RUN chmod +x /tmp/configuration-files.sh \ + && chmod +x /usr/local/bin/entrypoint.sh + +CMD /usr/local/bin/entrypoint.sh \ No newline at end of file diff --git a/openvidu-server/docker/openvidu-coturn/README.md b/openvidu-server/docker/openvidu-coturn/README.md new file mode 100644 index 00000000..df542138 --- /dev/null +++ b/openvidu-server/docker/openvidu-coturn/README.md @@ -0,0 +1,36 @@ +# Coturn OpenVidu + +This is a docker image to launch a coturn server. Environment variables can be defined to modify the files `/etc/default/coturn` and `cat>/etc/turnserver.conf`. + +## Environment variables + +### Turn configuration +- TURN_PUBLIC_IP: Public ip where coturn will be placed. If this environment variable is not setted, it will get the ip returned by `curl ifconfig.co`. +- TURN_LISTEN_PORT: Port where turn will be listening. + +### Turn credentials +- REDIS_IP: Redis where credentials are stored +- DB_NAME: Name of the database in redis +- DB_PASSWORD: Password of the redis database + +# Execution example + +Actual version of OpenVidu need to be located in the same node because tokens sends the url for turn/stun connections with the host url. + +## Execute turn locally next to the redis database + +You need to have a redis database running: + +``` +docker run --rm --name some-redis -d -p 6379:6379 redis +``` + +Get the ip of the container and after that, run coturn, you can use url as ip too, in this example I am running coturn with nip.io: + +``` +docker run -it -e REDIS_IP=172.17.0.2 -e DB_NAME=0 -e DB_PASSWORD=turn -e MIN_PORT=40000 -e MAX_PORT=65535 -e TURN_LISTEN_PORT=3478 --network=host coturn-openvidu +``` + +# Kubernetes + +TODO diff --git a/openvidu-server/docker/openvidu-coturn/configuration-files.sh b/openvidu-server/docker/openvidu-coturn/configuration-files.sh new file mode 100644 index 00000000..3d94420c --- /dev/null +++ b/openvidu-server/docker/openvidu-coturn/configuration-files.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Enable turn +cat>/etc/default/coturn</etc/turnserver.conf<