From f7f35d75cd55a3de14616fecaaab8732794bf8fa Mon Sep 17 00:00:00 2001 From: chandi Date: Wed, 28 Oct 2020 16:11:21 +0100 Subject: [PATCH] :tada: no 'core' and dependency on the ubuntu repository anymore! (rewrite of bbb-web) --- docker-compose.yml | 5 +- mod/bbb-web/Dockerfile | 100 ++++++++++++++++++ .../web => bbb-web}/bigbluebutton.properties | 0 mod/bbb-web/entrypoint.sh | 17 +++ mod/bbb-web/logback.xml | 28 +++++ .../web => bbb-web}/turn-stun-servers.xml | 0 mod/core/Dockerfile | 78 -------------- mod/core/README.md | 6 -- mod/core/entrypoint.sh | 34 ------ mod/core/prefix-log | 16 --- mod/core/supervisord.conf | 8 -- mod/core/web-run.sh | 12 --- 12 files changed, 147 insertions(+), 157 deletions(-) create mode 100644 mod/bbb-web/Dockerfile rename mod/{core/web => bbb-web}/bigbluebutton.properties (100%) create mode 100755 mod/bbb-web/entrypoint.sh create mode 100644 mod/bbb-web/logback.xml rename mod/{core/web => bbb-web}/turn-stun-servers.xml (100%) delete mode 100644 mod/core/Dockerfile delete mode 100644 mod/core/README.md delete mode 100755 mod/core/entrypoint.sh delete mode 100755 mod/core/prefix-log delete mode 100644 mod/core/supervisord.conf delete mode 100755 mod/core/web-run.sh diff --git a/docker-compose.yml b/docker-compose.yml index 9cd3d2f..31e9868 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,8 @@ version: '3.6' services: - core: - build: mod/core + bbb-web: + build: mod/bbb-web restart: unless-stopped depends_on: - redis @@ -117,7 +117,6 @@ services: depends_on: - redis - kurento - - core environment: CLIENT_HOST: 0.0.0.0 KURENTO_NAME: kurento diff --git a/mod/bbb-web/Dockerfile b/mod/bbb-web/Dockerfile new file mode 100644 index 0000000..2991ea7 --- /dev/null +++ b/mod/bbb-web/Dockerfile @@ -0,0 +1,100 @@ +FROM mozilla/sbt:8u181_1.2.7 AS builder + +RUN apt-get update && apt-get install -y subversion + +# download bbb-common-message +ENV TAG_COMMON_MESSAGE v2.3-alpha-2 +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_COMMON_MESSAGE/bbb-common-message /bbb-common-message \ + && rm -rf /bbb-common-message/.svn + +# compile bbb-common-message +RUN cd /bbb-common-message \ + && ./deploy.sh + +# =================================================== + +# install grails +RUN cd /opt \ + && wget https://github.com/grails/grails-core/releases/download/v3.3.9/grails-3.3.9.zip \ + && unzip grails-3.3.9.zip +ENV PATH="/opt/grails-3.3.9/bin:${PATH}" + +# install gradle +RUN cd /opt \ + && wget https://services.gradle.org/distributions/gradle-6.7-bin.zip \ + && unzip gradle-6.7-bin +ENV PATH="/opt/gradle-6.7/bin:${PATH}" + +# download bbb-common-web +ENV TAG_COMMON_WEB v2.3-alpha-2 +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_COMMON_WEB/bbb-common-web /bbb-common-web \ + && rm -rf /bbb-common-message/.svn + +# compile bbb-common-web +RUN cd /bbb-common-web \ + && ./deploy.sh + +# download bbb-web +ENV TAG_WEB v2.3-alpha-2 +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_WEB/bigbluebutton-web /bbb-web \ + && rm -rf /bbb-web/.svn + +# compile bbb-web +RUN cd /bbb-web && grails assemble + +# compile pres-checker +RUN cd /bbb-web/pres-checker && gradle resolveDeps + + + +# =================================================== +FROM openjdk:8-jre-slim-buster + +RUN apt-get update && apt-get install -y \ + wget unzip gosu socat locales \ + imagemagick xpdf-utils + +# set locale +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + + +# add user & group +RUN groupadd -g 998 bigbluebutton && useradd -m -u 998 -g bigbluebutton bigbluebutton + +# add dockerize +ENV DOCKERIZE_VERSION v0.6.1 +RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + + +# add blank presentation files and allow conversation to pdf/svg +RUN mkdir -p /usr/share/bigbluebutton/blank \ + && cd /usr/share/bigbluebutton/blank \ + && wget \ + https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/v2.3-alpha-2/bigbluebutton-config/slides/blank-svg.svg \ + https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/v2.3-alpha-2/bigbluebutton-config/slides/blank-thumb.png \ + https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/v2.3-alpha-2/bigbluebutton-config/slides/blank-presentation.pdf \ + https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/v2.3-alpha-2/bigbluebutton-config/slides/blank-png.png \ + && sed -i 's///g' /etc/ImageMagick-6/policy.xml + +# get and extract bbb-web +COPY --from=builder /bbb-web/build/libs/bigbluebutton-0.10.0.war /bigbluebutton-0.10.0.war +RUN mkdir -p /usr/share/bbb-web \ + && cd /usr/share/bbb-web \ + && unzip -q /bigbluebutton-0.10.0.war -d /usr/share/bbb-web + +# get pres-checker +COPY --from=builder /bbb-web/pres-checker/lib /usr/share/prescheck/lib +COPY --from=builder /bbb-web/pres-checker/run.sh /usr/share/prescheck/prescheck.sh + +# add entrypoint and templates +COPY entrypoint.sh /entrypoint.sh +COPY bigbluebutton.properties /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl +COPY turn-stun-servers.xml /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml.tmpl +COPY logback.xml /usr/share/bbb-web/WEB-INF/classes/logback.xml + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/mod/core/web/bigbluebutton.properties b/mod/bbb-web/bigbluebutton.properties similarity index 100% rename from mod/core/web/bigbluebutton.properties rename to mod/bbb-web/bigbluebutton.properties diff --git a/mod/bbb-web/entrypoint.sh b/mod/bbb-web/entrypoint.sh new file mode 100755 index 0000000..e3933c6 --- /dev/null +++ b/mod/bbb-web/entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +# 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 + +cd /usr/share/bbb-web/ +dockerize \ + -template /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl:/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties \ + -template /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml.tmpl:/usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml \ + gosu bigbluebutton 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/bbb-web/logback.xml b/mod/bbb-web/logback.xml new file mode 100644 index 0000000..8fb5838 --- /dev/null +++ b/mod/bbb-web/logback.xml @@ -0,0 +1,28 @@ + + + + + %d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"} %-5level %logger{35} - %msg%n + + + + + + + + + + + + + + + + + + + + + + diff --git a/mod/core/web/turn-stun-servers.xml b/mod/bbb-web/turn-stun-servers.xml similarity index 100% rename from mod/core/web/turn-stun-servers.xml rename to mod/bbb-web/turn-stun-servers.xml diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile deleted file mode 100644 index 99f5c22..0000000 --- a/mod/core/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -FROM ubuntu:18.04 -MAINTAINER ffdixon@bigbluebutton.org - -ENV DEBIAN_FRONTEND noninteractive -ENV container docker -ENV DOCKERIZE_VERSION v0.6.1 - -RUN apt-get update && apt-get install -y software-properties-common language-pack-en wget apt-utils -RUN update-locale LANG=en_US.UTF-8 - -# install dockerize -RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz - -# install dev helpers -# 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 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 -RUN sh -c 'wget https://packages-eu.bigbluebutton.org/repo/bigbluebutton.asc -O- | apt-key add -' \ - && sh -c 'echo "deb https://ubuntu.bigbluebutton.org/bionic-230-dev bigbluebutton-bionic main" > /etc/apt/sources.list.d/bigbluebutton.list' - -# create dummy packages to satisfy dependencies -RUN equivs-control redis-server.control \ - && sed -i 's//redis-server/g' redis-server.control \ - && equivs-build redis-server.control \ - && dpkg -i /*.deb \ - && rm /*.deb - -RUN equivs-control bbb-libreoffice-docker.control \ - && sed -i 's//bbb-libreoffice-docker/g' bbb-libreoffice-docker.control \ - && equivs-build bbb-libreoffice-docker.control \ - && dpkg -i /*.deb \ - && rm /*.deb - -RUN echo '#!/bin/bash\necho "mocking: systemctl $@"' > /usr/bin/systemctl && chmod +x /usr/bin/systemctl - -# this variable is not used, but it triggers -# rebuilding from here on if changed -ENV VERSION v2.3-alpha-2 - -RUN apt-get update && apt-get install -y bbb-web openjdk-8-jre-headless - -# add blank presentation files and allow conversation to pdf/svg -RUN mkdir -p /usr/share/bigbluebutton/blank \ - && wget -O /usr/share/bigbluebutton/blank/blank-svg.svg https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$VERSION/bigbluebutton-config/slides/blank-svg.svg \ - && wget -O /usr/share/bigbluebutton/blank/blank-thumb.png https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$VERSION/bigbluebutton-config/slides/blank-thumb.png \ - && wget -O /usr/share/bigbluebutton/blank/blank-presentation.pdf https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$VERSION/bigbluebutton-config/slides/blank-presentation.pdf \ - && wget -O /usr/share/bigbluebutton/blank/blank-png.png https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$VERSION/bigbluebutton-config/slides/blank-png.png \ - && sed -i 's///g' /etc/ImageMagick-6/policy.xml - - -# -- copy configuration files - -COPY web/bigbluebutton.properties /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl -COPY web/turn-stun-servers.xml /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml.tmpl - -COPY web-run.sh /usr/share/bbb-web/run-prod.sh - -# add default presentation thumbnail -RUN mkdir -p /usr/share/bigbluebutton/blank \ - && wget -O /usr/share/bigbluebutton/blank/blank-thumb.png https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/v2.2.20/bigbluebutton-config/slides/blank-thumb.png - -COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf -COPY entrypoint.sh /entrypoint.sh - -COPY prefix-log /usr/local/bin/prefix-log -RUN mkdir -p /var/log/supervisor - -ENTRYPOINT ["/entrypoint.sh"] -CMD [] diff --git a/mod/core/README.md b/mod/core/README.md deleted file mode 100644 index 10eed17..0000000 --- a/mod/core/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# bbb-core -based on the bigbluebutton/docker with bbb-install.sh setup, but got so far reduced to following components: -- bbb-web -- bbb-fsesl-akka -- bbb-apps-akka -- bbb-transcode-akka diff --git a/mod/core/entrypoint.sh b/mod/core/entrypoint.sh deleted file mode 100755 index a2f6e2b..0000000 --- a/mod/core/entrypoint.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -export LANG=en_US.UTF-8 - -# generate bbb folders -mkdir -p /var/bigbluebutton/events -mkdir -p /var/bigbluebutton/captions -mkdir -p /var/bigbluebutton/captions/inbox -mkdir -p /var/bigbluebutton/basic_stats -mkdir -p /var/bigbluebutton/recording/raw -mkdir -p /var/bigbluebutton/recording/process -mkdir -p /var/bigbluebutton/recording/publish -mkdir -p /var/bigbluebutton/recording/publish/presentation -mkdir -p /var/bigbluebutton/recording/status -mkdir -p /var/bigbluebutton/recording/status/recorded -mkdir -p /var/bigbluebutton/recording/status/archived -mkdir -p /var/bigbluebutton/recording/status/processed -mkdir -p /var/bigbluebutton/recording/status/sanity -mkdir -p /var/bigbluebutton/published -mkdir -p /var/bigbluebutton/published/presentation -mkdir -p /var/bigbluebutton/deleted -mkdir -p /var/bigbluebutton/unpublished -mkdir -p /var/bigbluebutton/playback - -# add playback-presentation to /var/bigbluebutton volume -cp -r /usr/src/bbb-src-playback/* /var/bigbluebutton/playback - -# -- fix directory permissions -chown -R bigbluebutton:bigbluebutton /var/bigbluebutton - -dockerize \ - -template /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl:/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties \ - -template /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml.tmpl:/usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml \ - /usr/bin/supervisord --nodaemon diff --git a/mod/core/prefix-log b/mod/core/prefix-log deleted file mode 100755 index be973e3..0000000 --- a/mod/core/prefix-log +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# setup fd-3 to point to the original stdout -exec 3>&1 -# setup fd-4 to point to the original stderr -exec 4>&2 - -# get the prefix from SUPERVISOR_PROCESS_NAME environement variable -printf -v PREFIX "%-14.14s" ${SUPERVISOR_PROCESS_NAME} - -# reassign stdout and stderr to a preprocessed and redirected to the original stdout/stderr (3 and 4) we have create eralier -exec 1> >( perl -ne '$| = 1; print "'"${PREFIX}"' | $_"' >&3) -exec 2> >( perl -ne '$| = 1; print "'"${PREFIX}"' | $_"' >&4) - -# from here on everthing that outputs to stdout/stderr will be go through the perl script - -exec "$@" \ No newline at end of file diff --git a/mod/core/supervisord.conf b/mod/core/supervisord.conf deleted file mode 100644 index b6868c9..0000000 --- a/mod/core/supervisord.conf +++ /dev/null @@ -1,8 +0,0 @@ -[program:bbb-web] -command=/usr/local/bin/prefix-log /usr/share/bbb-web/run-prod.sh -user=bigbluebutton -directory=/usr/share/bbb-web -stdout_logfile=/dev/fd/1 -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/fd/2 -stderr_logfile_maxbytes=0 diff --git a/mod/core/web-run.sh b/mod/core/web-run.sh deleted file mode 100755 index b836b7a..0000000 --- a/mod/core/web-run.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/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 - -