Jitsi Meet as a Docker image

Jitsi Meet | Docker instance | Docker image | NGINX virtual host

we’re going for Devuan/dumb-init Docker image (not SVR4) and we’re going to start daemons in sequence within rc.local directly. No need to share ports nor volumes just yet.

    docker pull pbraun9/devuan
docker run -d --name meet-tmp --hostname meet-tmp --workdir /root pbraun9/devuan
docker logs meet-tmp
docker exec -ti meet-tmp /bin/bash

Setup

proceed with the jitsi-meet as Docker container guide but simply keep the default generated certs in there. no need to start nginx nor to run the LE script.

backup copy and handy symlinks for maintenance

cp -pi /etc/jitsi/videobridge/sip-communicator.properties /etc/jitsi/videobridge/sip-communicator.properties.dist

ln -s /etc/jitsi/videobridge/sip-communicator.properties /root/sip-communicator.properties
ln -s /etc/rc.local /root/rc.local

The FQDN

custom wrapper script for hosting any FQDN according to the instance hostname

vi UPDATE-HOSTNAME

#!/bin/bash

    [[ -z $HOSTNAME ]] && echo define HOSTNAME && exit 1
    echo HOSTNAME is $HOSTNAME

    for conf in \
            /etc/jitsi/jicofo/jicofo.conf \
            /etc/jitsi/jicofo/config \
            /etc/jitsi/meet/meet-tmp-config.js \
            /etc/jitsi/videobridge/config \
            /etc/jitsi/videobridge/jvb.conf \
            /etc/jitsi/videobridge/sip-communicator.properties \
            /etc/turnserver.conf \
            ; do
            echo -n updating $conf ...
            mv $conf $conf.tmp
            sed -r "s/meet-tmp/$HOSTNAME/" $conf.tmp > $conf && echo done || echo FAIL
            rm -f $conf.tmp
    done; unset conf

    for leftover in \
            /etc/prosody/conf.avail/meet-tmp.cfg.lua \
            /etc/nginx/sites-available/meet-tmp.conf \
            ; do
            echo -n removing $leftover ...
            rm -f $leftover && echo done || echo FAIL
    done; unset leftover

chmod +x UPDATE-HOSTNAME

The Docker/NAT settings

for JVB to work behind Docker-or-NAT

vi BEHIND-NAT

#!/bin/bash

[[ -z $facingip ]] && echo ERROR did not grab \$facingip from environment && exit 1
localip=`ifconfig eth0 | grep 'inet ' | awk '{print $2}'`

echo -n adding $localip/$facingip to jvb properties...
mv /etc/jitsi/videobridge/sip-communicator.properties /etc/jitsi/videobridge/sip-communicator.properties.tmp

# GETTING RID OF STUN_MAPPING_HARVESTER_ADDRESSES
grep -vE '^org.ice4j.ice.harvest.NAT_HARVESTER_|^org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES=' \
    /etc/jitsi/videobridge/sip-communicator.properties.tmp > /etc/jitsi/videobridge/sip-communicator.properties

# BEWARE OF INDENTATION HERE, THERE IS AN EOF WITHIN
cat >> /etc/jitsi/videobridge/sip-communicator.properties <<EOF && echo done || echo FAIL
org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=$localip
org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=$facingip
EOF
unset localip

chmod +x BEHIND-NAT

Boot-time

    vi /etc/rc.local

enable the previously mentioned scripts

/root/UPDATE-HOSTNAME
/root/BEHIND-NAT

for jicofo and jvb init scripts not to complain about relying pid files

    rm -f /var/run/jicofo.pid
    rm -f /var/run/jitsi-videobridge.pid

enable the services at startup — this is dumb-init, not SVR4

    service nginx start
    service prosody start
    service jicofo start
    service jitsi-videobridge2 start

eventually disable uuid daemon now that all required packages are installed

#service uuidd start

Ready to go

clean-up the instance before commit

    ls -lF /var/run/jicofo.pid # nope
    ls -lF /var/run/jitsi-videobridge.pid # nope
    history -c
    rm -f /root/.bash_history
    ^D

now convert the tweaked instance to an image

docker stop meet-tmp
docker commit meet-tmp pbraun9/meet
docker rm meet-tmp

Acceptance

    fqdn=meet.example.net
    instance=${fqdn%%\.*}
    facingip=x.x.x.x

    docker run -d --name $instance --hostname $fqdn -e facingip=$facingip --workdir /root \
            -p $facingip:80:80 \
            -p $facingip:443:443 \
            -p $facingip:10000:10000/udp \
            pbraun9/meet
    docker logs $instance
    docker exec -ti $instance /bin/bash

    cat /etc/jitsi/videobridge/sip-communicator.properties
    grep -r meet-tmp /etc/ # occurrences should be gone

Result on Docker Hub

docker login -u pbraun9
docker push pbraun9/meet

Jitsi Meet as a single instance, thanks to Devuan and dumb-init https://hub.docker.com/r/pbraun9/meet

TODO

Changelog

Sep 2021

Resources

rc.local busy

[SOLVED] Text file busy ? https://www.linuxquestions.org/questions/slackware-14/text-file-busy-4175671871/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | NU | HTML5
PROXYSELLER — the best individual proxy provider
Copyright © 2021 Pierre-Philipp Braun