Skip to content

Instantly share code, notes, and snippets.

@juhamust
Last active November 23, 2020 16:44
Show Gist options
  • Save juhamust/855e5a93f8e2c7abcdc345c5ac8cc9a9 to your computer and use it in GitHub Desktop.
Save juhamust/855e5a93f8e2c7abcdc345c5ac8cc9a9 to your computer and use it in GitHub Desktop.
Kurento Media Server with Docker and SSL support (WIP)
# stream oriented kurento
#
# VERSION 4.4.3
FROM ubuntu:14.04
MAINTAINER Patxi Gortázar <[email protected]>
RUN apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get install -y wget
RUN echo "deb http://ubuntu.kurento.org/ trusty kms6" | tee /etc/apt/sources.list.d/kurento.list \
&& wget -O - http://ubuntu.kurento.org/kurento.gpg.key | apt-key add - \
&& apt-get update \
&& apt-get -y install kurento-media-server-6.0 \
&& apt-get -y install kms-pointerdetector-6.0 \
&& apt-get -y install gnutls-bin \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 8888 8443
RUN certtool --generate-privkey --outfile /etc/kurento/defaultCertificate.pem
RUN echo 'organization = your organization name' > /etc/kurento/certtool.tmpl
RUN certtool --generate-self-signed --load-privkey /etc/kurento/defaultCertificate.pem --template /etc/kurento/certtool.tmpl >> /etc/kurento/defaultCertificate.pem
RUN chown kurento /etc/kurento/defaultCertificate.pem
COPY ./kurento.conf.json /etc/kurento/kurento.conf.json
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV GST_DEBUG=Kurento*:5
ENTRYPOINT ["/entrypoint.sh"]
#!/bin/bash
set -e
if [ ! -z "$COTURN_PORT_3478_TCP_ADDR" ]; then
if [ ! -z "$COTURN_PORT_3478_TCP_PORT" ]; then
# Generate WebRtcEndpoint configuration
echo "stunServerAddress=$COTURN_PORT_3478_TCP_ADDR" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
echo "stunServerPort=$COTURN_PORT_3478_TCP_PORT" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
fi
# Remove ipv6 local loop until ipv6 is supported
cat /etc/hosts | sed '/::1/d' | tee /etc/hosts > /dev/null
exec /usr/bin/kurento-media-server "$@"
{
"mediaServer" : {
"resources": {
"exceptionLimit": "0.8",
"killLimit": "0.7",
"garbageCollectorPeriod": 240
},
"net" : {
"websocket": {
"port": 8888,
"secure": {
"port": 8433,
"certificate": "/etc/kurento/defaultCertificate.pem",
"password": ""
},
"path": "kurento",
"threads": 10
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment