Make the various used ports configurable
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -443,9 +443,19 @@ ENV \
|
||||
MODE="primary" \
|
||||
ENABLE_VNC_AUDIO="true"
|
||||
|
||||
# Be sure that the noVNC port is exposed
|
||||
EXPOSE 8083
|
||||
# Configure required ports
|
||||
ENV \
|
||||
PORT_SSH="2222" \
|
||||
PORT_VNC="5900" \
|
||||
PORT_AUDIO_STREAM="5901" \
|
||||
PORT_NOVNC_WEB="8083" \
|
||||
PORT_AUDIO_WEBSOCKET="32123"
|
||||
|
||||
# Expose the required ports
|
||||
EXPOSE 2222
|
||||
EXPOSE 5900
|
||||
EXPOSE 5901
|
||||
EXPOSE 8083
|
||||
EXPOSE 32123
|
||||
|
||||
# Set entrypoint
|
||||
|
||||
@@ -412,9 +412,19 @@ ENV \
|
||||
MODE="primary" \
|
||||
ENABLE_VNC_AUDIO="true"
|
||||
|
||||
# Be sure that the noVNC port is exposed
|
||||
EXPOSE 8083
|
||||
# Configure required ports
|
||||
ENV \
|
||||
PORT_SSH="2222" \
|
||||
PORT_VNC="5900" \
|
||||
PORT_AUDIO_STREAM="5901" \
|
||||
PORT_NOVNC_WEB="8083" \
|
||||
PORT_AUDIO_WEBSOCKET="32123"
|
||||
|
||||
# Expose the required ports
|
||||
EXPOSE 2222
|
||||
EXPOSE 5900
|
||||
EXPOSE 5901
|
||||
EXPOSE 8083
|
||||
EXPOSE 32123
|
||||
|
||||
# Set entrypoint
|
||||
|
||||
@@ -9,6 +9,9 @@ if [ "${MODE}" != "s" ] & [ "${MODE}" != "secondary" ]; then
|
||||
# - https://github.com/calebj/noVNC
|
||||
if [ -f /opt/noVNC/audio.patch ]; then
|
||||
echo "Patching noVNC with audio websocket"
|
||||
# Enable supervisord script
|
||||
sed -i "s|32123|${PORT_AUDIO_WEBSOCKET}|" /opt/noVNC/audio.patch
|
||||
# Apply patch
|
||||
pushd /opt/noVNC/ &> /dev/null
|
||||
patch -p1 --input=/opt/noVNC/audio.patch --batch --quiet
|
||||
popd &> /dev/null
|
||||
|
||||
@@ -4,7 +4,7 @@ autostart=true
|
||||
autorestart=true
|
||||
priority=10
|
||||
user=root
|
||||
command=/usr/sbin/sshd -Ddp 2222
|
||||
command=/usr/sbin/sshd -Ddp "%(ENV_PORT_SSH)s"
|
||||
stopsignal=QUIT
|
||||
stdout_logfile=/var/log/supervisor/sshd.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
|
||||
@@ -4,7 +4,7 @@ autostart=false
|
||||
autorestart=true
|
||||
priority=10
|
||||
user=%(ENV_USER)s
|
||||
command=tcpserver localhost 5901 gst-launch-1.0 -q pulsesrc server=/tmp/pulseaudio.socket ! audio/x-raw, channels=2, rate=24000 ! cutter ! opusenc ! webmmux ! fdsink fd=1
|
||||
command=tcpserver localhost %(ENV_PORT_AUDIO_STREAM)s gst-launch-1.0 -q pulsesrc server=/tmp/pulseaudio.socket ! audio/x-raw, channels=2, rate=24000 ! cutter ! opusenc ! webmmux ! fdsink fd=1
|
||||
stopsignal=QUIT
|
||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/audiostream.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
@@ -18,7 +18,7 @@ autostart=false
|
||||
autorestart=true
|
||||
priority=10
|
||||
user=%(ENV_USER)s
|
||||
command=/usr/local/bin/websockify 32123 localhost:5901
|
||||
command=/usr/local/bin/websockify %(ENV_PORT_AUDIO_WEBSOCKET)s localhost:%(ENV_PORT_AUDIO_STREAM)s
|
||||
stopsignal=QUIT
|
||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/audiowebsock.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
|
||||
@@ -4,7 +4,7 @@ autostart=true
|
||||
autorestart=true
|
||||
priority=30
|
||||
user=%(ENV_USER)s
|
||||
command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -rfbport 5900 -shared -forever
|
||||
command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -rfbport %(ENV_PORT_VNC)s -shared -forever
|
||||
stopsignal=QUIT
|
||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/x11vnc.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
@@ -18,7 +18,7 @@ autostart=true
|
||||
autorestart=true
|
||||
priority=30
|
||||
user=%(ENV_USER)s
|
||||
command=/opt/noVNC/utils/launch.sh --vnc localhost:5900 --listen 8083
|
||||
command=/opt/noVNC/utils/launch.sh --vnc localhost:%(ENV_PORT_VNC)s --listen %(ENV_PORT_NOVNC_WEB)s
|
||||
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s"
|
||||
stopsignal=QUIT
|
||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/novnc.log
|
||||
|
||||
Reference in New Issue
Block a user