diff --git a/Dockerfile.example b/Dockerfile.example index d8317106..994d06eb 100644 --- a/Dockerfile.example +++ b/Dockerfile.example @@ -99,7 +99,9 @@ Pin-Priority: -1" > /etc/apt/preferences.d/firefox-nosnap && \ adwaita-icon-theme-full \ dbus-x11 \ x11-apps \ - firefox && \ + firefox \ + jstest-gtk \ + coturn && \ rm -rf /var/lib/apt/lists/* && \ update-alternatives --set x-www-browser /usr/bin/firefox @@ -147,6 +149,25 @@ RUN echo 'export DISPLAY=:0' \ echo 'source /opt/gstreamer/gst-env' \ >> /etc/bash.bashrc +# Write turnserver script +RUN echo "#!/bin/bash\n\ +exec turnserver\n\ + --verbose\n\ + --no-tls\n\ + --listening-ip=0.0.0.0\n\ + --listening-port=\${TURN_PORT:-3478}\n\ + --realm=\${TURN_REALM:-example.com}\n\ + --channel-lifetime=\${TURN_CHANNEL_LIFETIME:--1}\n\ + --min-port=\${TURN_MIN_PORT:-49152}\n\ + --max-port=\${TURN_MAX_PORT:-65535}\n\ + --user selkies:selkies\n\ + --no-cli\n\ + --cli-password selkies\n\ + --allow-loopback-peers\n\ + --db \${HOME}/.config/turndb\n\ + \${EXTRA_ARGS} \$@\n\ +" > /start-turnserver.sh && chmod +x /start-turnserver.sh + # Write startup script RUN echo "#!/bin/bash\n\ export DISPLAY=:0\n\ @@ -159,8 +180,14 @@ export PULSE_SERVER=unix:/run/pulse/native\n\ sudo /usr/bin/pulseaudio -k >/dev/null 2>&1\n\ sudo /usr/bin/pulseaudio --daemonize --system --verbose --log-target=file:/tmp/pulseaudio.log --realtime=true --disallow-exit -L 'module-native-protocol-tcp auth-ip-acl=127.0.0.0/8 port=4713 auth-anonymous=1'\n\ [[ \${START_XFCE4:-true} == 'true' ]] && rm -rf ~/.config/xfce4 && xfce4-session &\n\ +/start-turnserver.sh &\n\ export WEBRTC_ENCODER=\${WEBRTC_ENCODER:-x264enc}\n\ export WEBRTC_ENABLE_RESIZE=\${WEBRTC_ENABLE_RESIZE:-true}\n\ +export TURN_HOST=\${TURN_HOST:-localhost}\n\ +export TURN_PORT=\${TURN_PORT:-3478}\n\ +export TURN_USERNAME=\${TURN_USERNAME:-selkies}\n\ +export TURN_PASSWORD=\${TURN_PASSWORD:-selkies}\n\ +export TURN_PROTOCOL=\${TURN_PROTOCOL:-tcp}\n\ selkies-gstreamer-resize 1280x720\n\ selkies-gstreamer\n\ " > /entrypoint.sh && chmod +x /entrypoint.sh