diff --git a/docker-compose.yml b/docker-compose.yml index 4400a43..62088ee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: restart: unless-stopped depends_on: - redis + - libreoffice environment: DEV_MODE: ${DEV_MODE:-} DOMAIN: ${DOMAIN} @@ -20,6 +21,7 @@ services: - bigbluebutton:/var/bigbluebutton - vol-freeswitch:/var/freeswitch/meetings - vol-kurento:/var/kurento + - vol-libreoffice:/var/tmp/soffice networks: bbb-net: ipv4_address: 10.7.7.2 @@ -165,6 +167,17 @@ services: bbb-net: ipv4_address: 10.7.7.14 + libreoffice: + build: mod/libreoffice + restart: unless-stopped + volumes: + - vol-libreoffice:/var/tmp/soffice + tmpfs: + - /tmp + networks: + bbb-net: + ipv4_address: 10.7.7.7 + periodic: build: mod/periodic restart: unless-stopped @@ -181,7 +194,11 @@ volumes: bigbluebutton: vol-freeswitch: vol-kurento: +<<<<<<< HEAD html5-static: +======= + vol-libreoffice: +>>>>>>> b6193c1 (v2.3: dockerized libreoffice) networks: bbb-net: diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile index a2b34a1..5e07172 100644 --- a/mod/core/Dockerfile +++ b/mod/core/Dockerfile @@ -17,7 +17,10 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI # RUN apt-get install -y tcpdump telnet htop vim # -- Install Dependencies -RUN apt-get install -y supervisor apt-transport-https equivs haveged fonts-crosextra-carlito fonts-crosextra-caladea fonts-noto net-tools +RUN apt-get install -y supervisor apt-transport-https equivs haveged fonts-crosextra-carlito fonts-crosextra-caladea fonts-noto net-tools socat + +# add bigbluebutton user manually so the ID is constant +RUN groupadd -g 998 bigbluebutton && useradd -m -u 998 -g bigbluebutton bigbluebutton # bbb repo & packages RUN LC_CTYPE=C.UTF-8 add-apt-repository ppa:bigbluebutton/support @@ -43,7 +46,6 @@ RUN echo '#!/bin/bash\necho "mocking: systemctl $@"' > /usr/bin/systemctl && chm # rebuilding from here on if changed ENV VERSION v2.3-alpha-2 -RUN apt-get update && apt-get install -y openjdk-8-jre-headless poppler-utils imagemagick RUN apt-get update && apt-get install -y bbb-web bbb-apps-akka # add blank presentation files and allow conversation to pdf/svg diff --git a/mod/core/supervisord.conf b/mod/core/supervisord.conf index 6e839c9..54eb005 100644 --- a/mod/core/supervisord.conf +++ b/mod/core/supervisord.conf @@ -15,12 +15,3 @@ stdout_logfile=/dev/fd/1 stdout_logfile_maxbytes=0 stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 - -[program:bbb-transcode-akka] -command=/usr/local/bin/prefix-log /usr/share/bbb-transcode-akka/bin/bbb-transcode-akka -user=bigbluebutton -directory=/usr/share/bbb-transcode-akka -stdout_logfile=/dev/fd/1 -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/fd/2 -stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/mod/core/web-run.sh b/mod/core/web-run.sh index d92dee7..b836b7a 100755 --- a/mod/core/web-run.sh +++ b/mod/core/web-run.sh @@ -1,4 +1,12 @@ #!/bin/bash + +# forward libreoffice ports to this container +for i in `seq 1 4` ; do + let PORT=8200+${i} + echo "forward port $PORT to the libreoffice container" + socat TCP-LISTEN:$PORT,fork TCP:10.7.7.7:$PORT & +done + java -Dgrails.env=prod -Dserver.address=0.0.0.0 -Dserver.port=8090 -Xms384m -Xmx384m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/bigbluebutton/diagnostics -cp WEB-INF/lib/*:/:WEB-INF/classes/:. org.springframework.boot.loader.WarLauncher diff --git a/mod/libreoffice/Dockerfile b/mod/libreoffice/Dockerfile new file mode 100644 index 0000000..4c411ba --- /dev/null +++ b/mod/libreoffice/Dockerfile @@ -0,0 +1,11 @@ +FROM woahbase/alpine-libreoffice + +USER root + +RUN apk add su-exec +# should use the same user ID as in `core` to avoid file permission issues +RUN addgroup -g 998 bigbluebutton && adduser -D -u 998 -G bigbluebutton bigbluebutton +COPY entrypoint.sh /entrypoint.sh + + +ENTRYPOINT /entrypoint.sh diff --git a/mod/libreoffice/entrypoint.sh b/mod/libreoffice/entrypoint.sh new file mode 100755 index 0000000..b19e7e2 --- /dev/null +++ b/mod/libreoffice/entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +for i in `seq 1 4` ; do + + SOFFICE_WORK_DIR="/var/tmp/soffice/instance_"`printf "%02d\n" ${i}` + mkdir -p $SOFFICE_WORK_DIR + chown bigbluebutton:bigbluebutton $SOFFICE_WORK_DIR + + # Initialize environment + su-exec bigbluebutton /usr/lib/libreoffice/program/soffice.bin -env:UserInstallation="file:///tmp/office_${i}/" +done + + +for i in `seq 1 4` ; do + let PORT=8200+${i} + echo "start libreoffice on port ${PORT}" + su-exec bigbluebutton /usr/lib/libreoffice/program/soffice.bin --accept="socket,host=0.0.0.0,port=$PORT,tcpNoDelay=1;urp;StarOffice.ServiceManager" --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nolockcheck --nologo --norestore -env:UserInstallation="file:///tmp/office_${i}/" & +done + +wait $!