From 83eee1822873f064656b9a3543cbbe226be3b2d3 Mon Sep 17 00:00:00 2001 From: chandi Date: Sun, 3 Apr 2022 23:18:15 +0200 Subject: [PATCH] all tags specified in one file and images built with official docker-bbb-build image --- .gitmodules | 9 ++++ docker-compose.tmpl.yml | 50 ++++++++++++++++---- mod/apps-akka/Dockerfile | 40 +++++----------- mod/apps-akka/bbb-apps-akka.conf | 4 +- mod/apps-akka/entrypoint.sh | 9 ++++ mod/base-java/Dockerfile | 24 ++++++++++ mod/bbb-web/Dockerfile | 55 +++++----------------- mod/freeswitch/Dockerfile | 4 +- mod/fsesl-akka/Dockerfile | 44 +++++------------ mod/fsesl-akka/bbb-fsesl-akka.conf | 2 +- mod/fsesl-akka/entrypoint.sh | 9 ++++ mod/html5/Dockerfile | 46 +++++++----------- mod/nginx/Dockerfile | 6 +-- mod/nginx/bbb-playback | 1 + mod/recordings/Dockerfile | 14 +++--- mod/webrtc-sfu/Dockerfile | 31 ++++++------ mod/webrtc-sfu/docker-entrypoint.sh | 2 +- scripts/generate-compose | 11 +++++ scripts/print-versions | 73 ----------------------------- scripts/setup | 3 ++ scripts/upgrade | 1 + tags.env | 21 +++++++++ 22 files changed, 216 insertions(+), 243 deletions(-) create mode 100755 mod/apps-akka/entrypoint.sh create mode 100644 mod/base-java/Dockerfile create mode 100755 mod/fsesl-akka/entrypoint.sh create mode 160000 mod/nginx/bbb-playback delete mode 100755 scripts/print-versions create mode 100644 tags.env diff --git a/.gitmodules b/.gitmodules index f808c89..cc00452 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,12 @@ [submodule "mod/etherpad/bbb-etherpad-plugin"] path = mod/etherpad/bbb-etherpad-plugin url = https://github.com/alangecker/bbb-etherpad-plugin +[submodule "mod/bbb-pads/bbb-pads"] + path = mod/bbb-pads/bbb-pads + url = https://github.com/bigbluebutton/bbb-pads +[submodule "mod/webhooks/bbb-webhooks"] + path = mod/webhooks/bbb-webhooks + url = https://github.com/bigbluebutton/bbb-webhooks +[submodule "mod/nginx/bbb-playback"] + path = mod/nginx/bbb-playback + url = https://github.com/bigbluebutton/bbb-playback diff --git a/docker-compose.tmpl.yml b/docker-compose.tmpl.yml index b33e7b4..dcd9ca1 100644 --- a/docker-compose.tmpl.yml +++ b/docker-compose.tmpl.yml @@ -7,7 +7,11 @@ version: '3.6' # html5 templates x-html5-backend: &html5backend - build: mod/html5 + build: + context: mod/html5 + args: + BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }} + TAG_HTML5: {{ .Env.TAG_HTML5 }} image: bbb-html5 restart: unless-stopped depends_on: @@ -39,7 +43,12 @@ x-html5-frontend: &html5frontend services: bbb-web: - build: mod/bbb-web + build: + context: mod/bbb-web + args: + BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }} + TAG_COMMON_MESSAGE: {{ .Env.TAG_COMMON_MESSAGE }} + TAG_BBB_WEB: {{ .Env.TAG_BBB_WEB }} restart: unless-stopped depends_on: - redis @@ -94,7 +103,11 @@ services: freeswitch: - build: mod/freeswitch + container_name: bbb-freeswitch + build: + context: mod/freeswitch + args: + TAG_FS_CONFIG: {{ .Env.TAG_FS_CONFIG }} restart: unless-stopped cap_add: - IPC_LOCK @@ -119,7 +132,10 @@ services: network_mode: host nginx: - build: mod/nginx + build: + context: mod/nginx + args: + TAG_LEARNING_DASHBOARD: {{ .Env.TAG_LEARNING_DASHBOARD }} restart: unless-stopped depends_on: - etherpad @@ -192,7 +208,10 @@ services: - vol-kurento:/var/kurento webrtc-sfu: - build: mod/webrtc-sfu + build: + context: mod/webrtc-sfu + args: + BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }} restart: unless-stopped depends_on: - redis @@ -217,10 +236,16 @@ services: ipv4_address: 10.7.7.10 fsesl-akka: - build: mod/fsesl-akka + build: + context: mod/fsesl-akka + args: + BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }} + TAG_COMMON_MESSAGE: {{ .Env.TAG_COMMON_MESSAGE }} + TAG_FSESL_AKKA: {{ .Env.TAG_FSESL_AKKA }} restart: unless-stopped depends_on: - redis + - freeswitch environment: FSESL_PASSWORD: ${FSESL_PASSWORD:-ClueCon} networks: @@ -228,7 +253,12 @@ services: ipv4_address: 10.7.7.14 apps-akka: - build: mod/apps-akka + build: + context: mod/apps-akka + args: + BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }} + TAG_COMMON_MESSAGE: {{ .Env.TAG_COMMON_MESSAGE }} + TAG_APPS_AKKA: {{ .Env.TAG_APPS_AKKA }} restart: unless-stopped depends_on: - redis @@ -275,7 +305,11 @@ services: {{ if isTrue .Env.ENABLE_RECORDING }} # recordings recordings: - build: mod/recordings + build: + context: mod/recordings + args: + BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }} + TAG_RECORDINGS: {{ .Env.TAG_RECORDINGS }} restart: unless-stopped depends_on: - redis diff --git a/mod/apps-akka/Dockerfile b/mod/apps-akka/Dockerfile index 038c30a..3d260b4 100644 --- a/mod/apps-akka/Dockerfile +++ b/mod/apps-akka/Dockerfile @@ -1,21 +1,19 @@ -FROM mozilla/sbt:8u212_1.2.8 AS builder +ARG BBB_BUILD_TAG +FROM gitlab.senfcall.de:5050/senfcall-public/docker-bbb-build:$BBB_BUILD_TAG AS builder -RUN apt-get update && apt-get install -y subversion +ARG TAG_COMMON_MESSAGE # download bbb-common-message -ENV TAG_COMMON_MESSAGE v2.4.5 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 - + && cd /bbb-common-message \ + && ./deploy.sh \ + && rm -rf /bbb-common-message # =================================================== -ENV TAG v2.4.5 -RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/akka-bbb-apps /source \ +ARG TAG_APPS_AKKA + +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_APPS_AKKA/akka-bbb-apps /source \ && rm -rf /source/.svn # compile and unzip bin @@ -25,24 +23,12 @@ RUN cd /source \ # =================================================== -FROM openjdk:8-jre-slim-bullseye - -RUN apt update && apt-get install -y wget gosu - -# install dockerize -ENV DOCKERIZE_VERSION v0.6.1 -RUN wget -q 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 - -RUN groupadd -g 998 bigbluebutton \ - && useradd -m -u 998 -g bigbluebutton bigbluebutton +FROM bbb-docker-base-java COPY --from=builder /bbb-apps-akka-0.0.4 /bbb-apps-akka COPY bbb-apps-akka.conf /etc/bigbluebutton/bbb-apps-akka.conf.tmpl COPY logback.xml /bbb-apps-akka/conf/logback.xml +COPY entrypoint.sh /entrypoint.sh -WORKDIR /bbb-apps-akka -CMD dockerize \ - -template /etc/bigbluebutton/bbb-apps-akka.conf.tmpl:/etc/bigbluebutton/bbb-apps-akka.conf \ - gosu bigbluebutton /bbb-apps-akka/bin/bbb-apps-akka \ No newline at end of file +USER bigbluebutton +ENTRYPOINT /entrypoint.sh diff --git a/mod/apps-akka/bbb-apps-akka.conf b/mod/apps-akka/bbb-apps-akka.conf index a8c3499..d05cebc 100644 --- a/mod/apps-akka/bbb-apps-akka.conf +++ b/mod/apps-akka/bbb-apps-akka.conf @@ -6,8 +6,8 @@ redis { } services { - bbbWebAPI="https://{{ .Env.DOMAIN }}/bigbluebutton/api" - sharedSecret="{{ .Env.SHARED_SECRET }}" + bbbWebAPI="https://DOMAIN/bigbluebutton/api" + sharedSecret="SHARED_SECRET" } http { interface = "0.0.0.0" diff --git a/mod/apps-akka/entrypoint.sh b/mod/apps-akka/entrypoint.sh new file mode 100755 index 0000000..3938a7c --- /dev/null +++ b/mod/apps-akka/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh -e + +TARGET=/etc/bigbluebutton/bbb-apps-akka.conf +cp /etc/bigbluebutton/bbb-apps-akka.conf.tmpl $TARGET +sed -i "s/DOMAIN/$DOMAIN/" $TARGET +sed -i "s/SHARED_SECRET/$SHARED_SECRET/" $TARGET + +cd /bbb-apps-akka +/bbb-apps-akka/bin/bbb-apps-akka \ No newline at end of file diff --git a/mod/base-java/Dockerfile b/mod/base-java/Dockerfile new file mode 100644 index 0000000..571126c --- /dev/null +++ b/mod/base-java/Dockerfile @@ -0,0 +1,24 @@ +FROM openjdk:11-jre-slim-bullseye + +RUN apt-get update && apt-get install -y \ + wget unzip gosu locales \ + imagemagick xpdf-utils curl \ + && 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 \ + && mkdir /etc/bigbluebutton \ + && chown bigbluebutton:bigbluebutton /etc/bigbluebutton + +# add dockerize +ENV DOCKERIZE_VERSION v0.6.1 +RUN wget -q 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 + + diff --git a/mod/bbb-web/Dockerfile b/mod/bbb-web/Dockerfile index 2f4c648..f231b39 100644 --- a/mod/bbb-web/Dockerfile +++ b/mod/bbb-web/Dockerfile @@ -1,33 +1,20 @@ -FROM mozilla/sbt:8u212_1.2.8 AS builder +ARG BBB_BUILD_TAG +FROM gitlab.senfcall.de:5050/senfcall-public/docker-bbb-build:$BBB_BUILD_TAG AS builder -RUN apt-get update && apt-get install -y subversion +ARG TAG_COMMON_MESSAGE # download bbb-common-message -ENV TAG_COMMON_MESSAGE v2.4.5 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 + && cd /bbb-common-message \ + && ./deploy.sh \ + && rm -rf /bbb-common-message # =================================================== -# install grails -RUN cd /opt \ - && wget -q 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 -q https://services.gradle.org/distributions/gradle-6.7-bin.zip \ - && unzip gradle-6.7-bin -ENV PATH="/opt/gradle-6.7/bin:${PATH}" +ARG TAG_BBB_WEB # download bbb-common-web -ENV TAG_COMMON_WEB v2.4.5 -RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_COMMON_WEB/bbb-common-web /bbb-common-web \ +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_BBB_WEB/bbb-common-web /bbb-common-web \ && rm -rf /bbb-common-message/.svn # compile bbb-common-web @@ -35,8 +22,7 @@ RUN cd /bbb-common-web \ && ./deploy.sh # download bbb-web -ENV TAG_WEB v2.4.5 -RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_WEB/bigbluebutton-web /bbb-web \ +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_BBB_WEB/bigbluebutton-web /bbb-web \ && rm -rf /bbb-web/.svn # compile bbb-web @@ -50,28 +36,9 @@ RUN unzip -q /bbb-web/build/libs/bigbluebutton-0.10.0.war -d /dist # =================================================== -FROM openjdk:8-jre-slim-bullseye - -RUN apt-get update && apt-get install -y \ - wget unzip gosu locales \ - imagemagick xpdf-utils curl - -# 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 -q 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 +FROM bbb-docker-base-java +COPY --from=bbb-docker-base-java /usr/local/bin/dockerize /usr/local/bin/dockerize # add blank presentation files and allow conversation to pdf/svg RUN mkdir -p /usr/share/bigbluebutton/blank \ diff --git a/mod/freeswitch/Dockerfile b/mod/freeswitch/Dockerfile index 98b9b1f..107b8d5 100644 --- a/mod/freeswitch/Dockerfile +++ b/mod/freeswitch/Dockerfile @@ -47,8 +47,8 @@ RUN wget -q https://gitlab.senfcall.de/senfcall-public/mute-and-unmute-sounds/-/ # git sparse-checkout is not yet available with buster and there # is no other sane way of downloading a single directory via git -ENV TAG v2.3.4 -RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/bbb-voice-conference/config/freeswitch/conf /etc/freeswitch \ +ARG TAG_FS_CONFIG +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_FS_CONFIG/bbb-voice-conference/config/freeswitch/conf /etc/freeswitch \ && rm -rf /etc/freeswitch/.svn # the current available freeswitch-mod-opusfile is broken, diff --git a/mod/fsesl-akka/Dockerfile b/mod/fsesl-akka/Dockerfile index 428b39d..305a386 100644 --- a/mod/fsesl-akka/Dockerfile +++ b/mod/fsesl-akka/Dockerfile @@ -1,28 +1,23 @@ -FROM mozilla/sbt:8u212_1.2.8 AS builder +ARG BBB_BUILD_TAG +FROM gitlab.senfcall.de:5050/senfcall-public/docker-bbb-build:$BBB_BUILD_TAG AS builder -RUN apt-get update && apt-get install -y subversion +ARG TAG_COMMON_MESSAGE # download bbb-common-message -ENV TAG_COMMON_MESSAGE v2.4.5 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 - + && cd /bbb-common-message \ + && ./deploy.sh \ + && rm -rf /bbb-common-message # =================================================== -ENV TAG_FSESL v2.4.5 -RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_FSESL/bbb-fsesl-client /bbb-fsesl-client \ +ARG TAG_FSESL_AKKA +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_FSESL_AKKA/bbb-fsesl-client /bbb-fsesl-client \ && rm -rf /bbb-fsesl-client/.svn RUN cd /bbb-fsesl-client \ && ./deploy.sh - -ENV TAG v2.4.5 -RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/akka-bbb-fsesl /source \ +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_FSESL_AKKA/akka-bbb-fsesl /source \ && rm -rf /source/.svn # compile and unzip bin @@ -32,25 +27,12 @@ RUN unzip /source/target/universal/bbb-fsesl-akka-0.0.2.zip -d / # # =================================================== -FROM openjdk:8-jre-slim-bullseye - -RUN apt update && apt-get install -y wget gosu - -# install dockerize -ENV DOCKERIZE_VERSION v0.6.1 -RUN wget -q 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 - - -RUN groupadd -g 1007 fsesl-akka \ - && useradd -m -u 1007 -g fsesl-akka fsesl-akka +FROM bbb-docker-base-java COPY --from=builder /bbb-fsesl-akka-0.0.2 /bbb-fsesl-akka COPY bbb-fsesl-akka.conf /etc/bigbluebutton/bbb-fsesl-akka.conf.tmpl COPY logback.xml /bbb-fsesl-akka/conf/logback.xml +COPY entrypoint.sh /entrypoint.sh -WORKDIR /bbb-fsesl-akka -CMD dockerize \ - -template /etc/bigbluebutton/bbb-fsesl-akka.conf.tmpl:/etc/bigbluebutton/bbb-fsesl-akka.conf \ - gosu fsesl-akka /bbb-fsesl-akka/bin/bbb-fsesl-akka \ No newline at end of file +USER bigbluebutton +ENTRYPOINT /entrypoint.sh \ No newline at end of file diff --git a/mod/fsesl-akka/bbb-fsesl-akka.conf b/mod/fsesl-akka/bbb-fsesl-akka.conf index 59c2948..ed1b475 100644 --- a/mod/fsesl-akka/bbb-fsesl-akka.conf +++ b/mod/fsesl-akka/bbb-fsesl-akka.conf @@ -5,7 +5,7 @@ include "/bbb-fsesl-akka/conf/application.conf" freeswitch { esl { host="10.7.7.1" - password="{{ default .Env.FSESL_PASSWORD "ClueCon" }}" + password="FSESL_PASSWORD" } } diff --git a/mod/fsesl-akka/entrypoint.sh b/mod/fsesl-akka/entrypoint.sh new file mode 100755 index 0000000..2000ce3 --- /dev/null +++ b/mod/fsesl-akka/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh -e + +TARGET=/etc/bigbluebutton/bbb-fsesl-akka.conf + +cp /etc/bigbluebutton/bbb-fsesl-akka.conf.tmpl $TARGET +sed -i "s/FSESL_PASSWORD/$FSESL_PASSWORD/" $TARGET + +cd /bbb-fsesl-akka +/bbb-fsesl-akka/bin/bbb-fsesl-akka \ No newline at end of file diff --git a/mod/html5/Dockerfile b/mod/html5/Dockerfile index 0a26397..f5b2cce 100644 --- a/mod/html5/Dockerfile +++ b/mod/html5/Dockerfile @@ -1,31 +1,24 @@ -FROM node:14.18.1-bullseye-slim AS builder +ARG BBB_BUILD_TAG +FROM gitlab.senfcall.de:5050/senfcall-public/docker-bbb-build:$BBB_BUILD_TAG AS builder -RUN apt-get update && apt-get install -y wget curl subversion python3 build-essential -RUN groupadd -g 2000 meteor && useradd -m -u 2001 -g meteor meteor +# RUN groupadd -g 2000 meteor && useradd -m -u 2001 -g meteor meteor +# USER meteor +ARG TAG_HTML5 +RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_HTML5/bigbluebutton-html5 /source \ + && cd /source \ + && meteor npm ci --production \ + && METEOR_DISABLE_OPTIMISTIC_CACHING=1 meteor build --architecture os.linux.x86_64 --allow-superuser --directory /app \ + && rm -rf /source -# download dockerize -ENV DOCKERIZE_VERSION v0.6.1 -RUN wget -q 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 - -USER meteor -ENV METEOR_VERSION 2.5 -RUN curl -sL https://install.meteor.com?release=$METEOR_VERSION | sed s/--progress-bar/-sL/g | /bin/sh - -ENV TAG v2.4.5 -RUN cd ~ \ - && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/bigbluebutton-html5 \ - && mv ~/bigbluebutton-html5 ~/source \ - && cd ~/source \ - && ~/.meteor/meteor npm ci --production \ - && METEOR_DISABLE_OPTIMISTIC_CACHING=1 ~/.meteor/meteor build --architecture os.linux.x86_64 --directory ~/app \ - && rm -rf ~/source - -RUN cd ~/app/bundle/programs/server \ +RUN cd /app/bundle/programs/server \ && npm install --production +RUN sed -i "s/VERSION/$TAG_HTML5/" /app/bundle/programs/web.browser/head.html \ + && find /app/bundle/programs/web.browser -name '*.js' -exec gzip -k -f -9 '{}' \; \ + && find /app/bundle/programs/web.browser -name '*.css' -exec gzip -k -f -9 '{}' \; \ + && find /app/bundle/programs/web.browser -name '*.wasm' -exec gzip -k -f -9 '{}' \; + # ------------------------------ FROM node:14.18.1-alpine @@ -33,12 +26,9 @@ FROM node:14.18.1-alpine RUN addgroup -g 2000 meteor && \ adduser -D -u 2001 -G meteor meteor && \ apk add su-exec -COPY --from=builder /usr/local/bin/dockerize /usr/local/bin/dockerize -COPY --from=builder --chown=meteor:meteor /home/meteor/app/bundle /app +COPY --from=bbb-docker-base-java /usr/local/bin/dockerize /usr/local/bin/dockerize +COPY --from=builder --chown=meteor:meteor /app/bundle /app COPY entrypoint.sh /entrypoint.sh COPY bbb-html5.yml /app/bbb-html5.yml.tmpl ENTRYPOINT ["/entrypoint.sh"] - -# lets set the tag again, so that it is include in the image for later version retrieval -ENV TAG v2.4.5 diff --git a/mod/nginx/Dockerfile b/mod/nginx/Dockerfile index 4beccb2..e7788eb 100644 --- a/mod/nginx/Dockerfile +++ b/mod/nginx/Dockerfile @@ -4,13 +4,11 @@ RUN apk add subversion git # -------------------- -ENV TAG_LEARNING_DASHBOARD v2.4.5 +ARG TAG_LEARNING_DASHBOARD RUN svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_LEARNING_DASHBOARD/bbb-learning-dashboard /bbb-learning-dashboard && rm -r /bbb-learning-dashboard/.svn RUN cd /bbb-learning-dashboard && npm ci && npm run build -ENV TAG_PLAYBACK v3.3.0 -ENV REACT_APP_BBB_PLAYBACK_BUILD=$TAG_PLAYBACK -RUN svn checkout https://github.com/bigbluebutton/bbb-playback/tags/$TAG_PLAYBACK /bbb-playback && rm -r /bbb-playback/.svn +COPY ./bbb-playback /bbb-playback RUN cd /bbb-playback && npm ci && npm run build # -------------------- diff --git a/mod/nginx/bbb-playback b/mod/nginx/bbb-playback new file mode 160000 index 0000000..008f048 --- /dev/null +++ b/mod/nginx/bbb-playback @@ -0,0 +1 @@ +Subproject commit 008f04847dda5d23d772d20d718d042d54803335 diff --git a/mod/recordings/Dockerfile b/mod/recordings/Dockerfile index 36b5d3a..7acd64a 100644 --- a/mod/recordings/Dockerfile +++ b/mod/recordings/Dockerfile @@ -45,20 +45,20 @@ RUN mkdir -p \ /usr/local/bigbluebutton/core \ /etc/bigbluebutton -ENV TAG v2.4.4 +ARG TAG_RECORDINGS # add bbb-record-core (lib, scripts and Gemfile) RUN cd /usr/local/bigbluebutton/core \ - && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/core/lib \ - && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/core/scripts \ + && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_RECORDINGS/record-and-playback/core/lib \ + && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_RECORDINGS/record-and-playback/core/scripts \ && rm -rf /usr/local/bigbluebutton/core/*/.svn \ - && wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG/record-and-playback/core/Gemfile.lock \ - && wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG/record-and-playback/core/Gemfile \ - && wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG/record-and-playback/core/Rakefile + && wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG_RECORDINGS/record-and-playback/core/Gemfile.lock \ + && wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG_RECORDINGS/record-and-playback/core/Gemfile \ + && wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG_RECORDINGS/record-and-playback/core/Rakefile # add bbb-playback-presentation scripts RUN cd /tmp \ - && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/presentation/scripts \ + && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG_RECORDINGS/record-and-playback/presentation/scripts \ && rsync -av /tmp/scripts/ /usr/local/bigbluebutton/core/scripts/ \ && rm -rf /tmp/scripts diff --git a/mod/webrtc-sfu/Dockerfile b/mod/webrtc-sfu/Dockerfile index 72884c4..c01d937 100644 --- a/mod/webrtc-sfu/Dockerfile +++ b/mod/webrtc-sfu/Dockerfile @@ -1,36 +1,37 @@ -FROM node:14-bullseye-slim +ARG BBB_BUILD_TAG +FROM gitlab.senfcall.de:5050/senfcall-public/docker-bbb-build:$BBB_BUILD_TAG AS builder -RUN apt-get update && apt-get -y install \ - git \ - make \ - python \ - python3-pip \ - g++ \ - ffmpeg - RUN useradd --uid 2004 --user-group webrtc-sfu -ADD ./bbb-webrtc-sfu app +ADD ./bbb-webrtc-sfu /app -WORKDIR app ENV NODE_ENV production - # due to the git submodule npm install crashes with following error: # npm ERR! fatal: Not a git repository: ../.git/modules/bbb-webrtc-sfu # we simply delete the .git file -RUN cp config/default.example.yml config/production.yml \ - && chown -R webrtc-sfu:webrtc-sfu config \ +RUN cd /app \ + && cp config/default.example.yml config/production.yml \ && rm .git \ && npm install --unsafe-perm \ && npm cache clear --force \ && rm -rf node_modules/mediasoup/worker/out/Release/subprojects \ && rm -rf node_modules/mediasoup/worker/out/Release/mediasoup-worker.p \ && rm -rf node_modules/mediasoup/worker/out/Release/deps + + +# ============================= +FROM node:14.18.1-bullseye-slim +RUN useradd --uid 2004 --user-group webrtc-sfu +ENV NODE_ENV production + +COPY --from=builder /app /app +RUN chown -R webrtc-sfu:webrtc-sfu /app/config + COPY docker-entrypoint.sh /app/docker-entrypoint.sh USER webrtc-sfu -ENTRYPOINT [ "./docker-entrypoint.sh" ] +ENTRYPOINT [ "/app/docker-entrypoint.sh" ] CMD [ "npm", "start" ] diff --git a/mod/webrtc-sfu/docker-entrypoint.sh b/mod/webrtc-sfu/docker-entrypoint.sh index 243593c..0f1218e 100755 --- a/mod/webrtc-sfu/docker-entrypoint.sh +++ b/mod/webrtc-sfu/docker-entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/sh -e - +cd /app sed -i "s|^\(localIpAddress\):.*|\1: \"10.7.7.10\"|g" config/production.yml export KURENTO_IP="10.7.7.1" diff --git a/scripts/generate-compose b/scripts/generate-compose index bd7d710..f63cb96 100755 --- a/scripts/generate-compose +++ b/scripts/generate-compose @@ -33,9 +33,20 @@ if [ "$ENABLE_COTURN" == true ]; then fi fi +export $(cat tags.env | sed 's/#.*//g' | xargs) + docker run \ --rm \ -v $(pwd)/docker-compose.tmpl.yml:/docker-compose.tmpl.yml \ + -e BBB_BUILD_TAG=${BBB_BUILD_TAG} \ + -e TAG_COMMON_MESSAGE=${TAG_COMMON_MESSAGE} \ + -e TAG_APPS_AKKA=${TAG_APPS_AKKA} \ + -e TAG_FSESL_AKKA=${TAG_FSESL_AKKA} \ + -e TAG_BBB_WEB=${TAG_BBB_WEB} \ + -e TAG_HTML5=${TAG_HTML5} \ + -e TAG_FS_CONFIG=${TAG_FS_CONFIG} \ + -e TAG_LEARNING_DASHBOARD=${TAG_LEARNING_DASHBOARD} \ + -e TAG_RECORDINGS=${TAG_RECORDINGS} \ -e DEV_MODE=${DEV_MODE:-false} \ -e ENABLE_RECORDING=${ENABLE_RECORDING:-false} \ -e REMOVE_OLD_RECORDING=${REMOVE_OLD_RECORDING:-false} \ diff --git a/scripts/print-versions b/scripts/print-versions deleted file mode 100755 index b11419c..0000000 --- a/scripts/print-versions +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -set -e - -CORE_IMAGE=$(docker-compose images -q core) -FREESWITCH_IMAGE=$(docker-compose images -q freeswitch) -HTML5_IMAGE=$(docker-compose images -q html5) -KURENTO_IMAGE=$(docker-compose images -q kurento) -ETHERPAD_IMAGE=$(docker-compose images -q etherpad) -MONGO_IMAGE=$(docker-compose images -q mongodb) -REDIS_IMAGE=$(docker-compose images -q redis) - -if [[ -z $CORE_IMAGE ]] -then - echo "this script only works if containers are created" - echo "either start BigBlueButton with" - echo " $ docker-compose up -d" - echo "or at least create the containers with" - echo " $ docker-compose create" - exit 1 -fi - - - -echo "bigbluebutton-docker" -echo " commit: $(git rev-parse --short HEAD) ($(git log -1 --pretty=%B | head -n 1))" -echo " branch: $(git rev-parse --abbrev-ref HEAD)" -echo "" - -echo "core" -docker run --rm --entrypoint /bin/sh $CORE_IMAGE -c "dpkg -l 'bbb-*' | grep ii | cut -c 5-42 | sed 's/bbb-/ bbb-/g'" -echo "" - -echo "etherpad" -ETHERPAD_VERSION=$(docker run --rm --entrypoint cat $ETHERPAD_IMAGE /opt/etherpad-lite/src/package.json | grep version | awk -F'"' '{print $4}') -echo " version: $ETHERPAD_VERSION" -echo "" - -echo "freeswitch" -FREESWITCH_VERSION=$(docker run --rm --entrypoint freeswitch $FREESWITCH_IMAGE -version | cut -c 21-) -FREESWTICH_CONFIG_VERSION=$(docker image inspect $FREESWITCH_IMAGE | grep GIT_TAG= | head -n 1 | xargs | cut -c 9-) -echo " build: $FREESWITCH_VERSION" -echo " config: $FREESWTICH_CONFIG_VERSION" -echo "" - -echo "html5" -HTML5_VERSION=$(docker image inspect $HTML5_IMAGE | grep TAG= | head -n 1 | xargs | cut -c 5-) -echo " version: $HTML5_VERSION" -echo "" - -echo "kurento" -KURENTO_VERSION=$(docker run --rm --entrypoint kurento-media-server $KURENTO_IMAGE --version | grep Kurento | sed 's/Kurento Media Server version: //') -echo " version: $KURENTO_VERSION" -echo "" - -echo "mongodb" -MONGO_VERSION=$(docker image inspect $MONGO_IMAGE | grep MONGO_VERSION | head -n 1 | xargs | cut -c 15-) -echo " version: $MONGO_VERSION" -echo "" - -# TODO: -# - nginx -# - periodic - -echo "redis" -REDIS_VERSION=$(docker image inspect $REDIS_IMAGE | grep REDIS_VERSION | head -n 1 | xargs | cut -c 15-) -echo " version: $REDIS_VERSION" -echo "" - -echo "webrtc-sfu" -SFU_VERSION=$(cd bbb-webrtc-sfu && cat package.json | grep version | awk -F\" '{print $4}') -SFU_COMMIT=$(cd bbb-webrtc-sfu && git rev-parse --short HEAD) -echo " version: $SFU_VERSION" -echo " commit: $SFU_COMMIT" diff --git a/scripts/setup b/scripts/setup index 3f4ecdf..014b689 100755 --- a/scripts/setup +++ b/scripts/setup @@ -198,6 +198,9 @@ sed -i "s/POSTGRESQL_SECRET=.*/POSTGRESQL_SECRET=$RANDOM_5/" .env ./scripts/generate-compose +echo "building bbb-docker-base-java" +docker build -t bbb-docker-base-java mod/base-java + echo "--------------------------------------------------" echo "configuration file .env got successfully created!" echo "" diff --git a/scripts/upgrade b/scripts/upgrade index d1fab6a..be7451a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,6 +30,7 @@ else echo "" echo "# rebuild images" + docker build -t bbb-docker-base-java mod/base-java # rebuild everything which got modified docker-compose build --pull diff --git a/tags.env b/tags.env new file mode 100644 index 0000000..77af3fe --- /dev/null +++ b/tags.env @@ -0,0 +1,21 @@ +# after changing a tag always run following commands to apply +# - ./scripts/generate-compose +# - docker-compose build + + +# https://gitlab.senfcall.de/senfcall-public/docker-bbb-build +BBB_BUILD_TAG=v2022-03-30 + +# https://github.com/bigbluebutton/bigbluebutton +TAG_COMMON_MESSAGE=v2.5.0-alpha.6 +TAG_APPS_AKKA=v2.5.0-alpha.6 +TAG_FSESL_AKKA=v2.5.0-alpha.6 +TAG_BBB_WEB=v2.5.0-alpha.6 +TAG_HTML5=v2.5.0-alpha.6 +TAG_RECORDINGS=v2.5.0-alpha.6 + +TAG_LEARNING_DASHBOARD=v2.5.0-alpha.6 +TAG_FS_CONFIG=v2.5.0-alpha.6 + + +IMAGE_NODE=node:14.18.1-bullseye-slim \ No newline at end of file