diff --git a/docker-compose.tmpl.yml b/docker-compose.tmpl.yml index e9e2d48..06fec1b 100644 --- a/docker-compose.tmpl.yml +++ b/docker-compose.tmpl.yml @@ -482,12 +482,28 @@ services: - ./data/bigbluebutton:/var/bigbluebutton - ./data/freeswitch-meetings:/var/freeswitch/meetings - ./data/mediasoup:/var/mediasoup + - ./data/bbb-webrtc-recorder:/var/lib/bbb-webrtc-recorder tmpfs: - /var/log/bigbluebutton - /tmp networks: bbb-net: ipv4_address: 10.7.7.16 + + bbb-webrtc-recorder: + build: + context: mod/bbb-webrtc-recorder + additional_contexts: + - src=./repos/bbb-webrtc-recorder + image: alangecker/bbb-docker-webrtc-recorder:{{ .Env.TAG_WEBRTC_RECORDER }} + depends_on: + - redis + volumes: + - ./mod/bbb-webrtc-recorder/bbb-webrtc-recorder.yml:/etc/bbb-webrtc-recorder/bbb-webrtc-recorder.yml + - ./data/bbb-webrtc-recorder:/var/lib/bbb-webrtc-recorder + networks: + bbb-net: + ipv4_address: 10.7.7.19 {{end}} {{ if isTrue .Env.ENABLE_WEBHOOKS }} diff --git a/mod/bbb-webrtc-recorder/Dockerfile b/mod/bbb-webrtc-recorder/Dockerfile new file mode 100644 index 0000000..bfe04a0 --- /dev/null +++ b/mod/bbb-webrtc-recorder/Dockerfile @@ -0,0 +1,35 @@ +# Build stage +FROM golang:1.19 as builder + +ARG APP_VERSION=devel +ARG GOMOD=github.com/bigbluebutton/bbb-webrtc-recorder + +WORKDIR /app + +COPY --from=src go.* ./ + +RUN go mod tidy + +COPY --from=src . ./ + +RUN go build -o ./build/bbb-webrtc-recorder \ + -buildvcs=false \ + -ldflags="-X '${GOMOD}/internal.AppVersion=${APP_VERSION}'" \ + ./cmd/bbb-webrtc-recorder + +RUN mv /app/build/bbb-webrtc-recorder /usr/bin/bbb-webrtc-recorder + +RUN rm -rf /app + +# Running stage +FROM debian:bookworm-slim + +RUN apt-get update && apt-get install -y gosu + +# Copy the binary to the production image from the builder stage. +COPY --from=builder /usr/bin/bbb-webrtc-recorder /usr/bin/bbb-webrtc-recorder + +# use same UID as in the recordings container +RUN groupadd -g 998 bigbluebutton && useradd -m -u 998 -g bigbluebutton bigbluebutton + +CMD ["/bin/sh", "-c", "chown -R bigbluebutton:bigbluebutton /var/lib/bbb-webrtc-recorder && gosu bigbluebutton /usr/bin/bbb-webrtc-recorder"] \ No newline at end of file diff --git a/mod/bbb-webrtc-recorder/bbb-webrtc-recorder.yml b/mod/bbb-webrtc-recorder/bbb-webrtc-recorder.yml new file mode 100644 index 0000000..6b284ca --- /dev/null +++ b/mod/bbb-webrtc-recorder/bbb-webrtc-recorder.yml @@ -0,0 +1,39 @@ +debug: false + +recorder: + directory: /var/lib/bbb-webrtc-recorder + dirFileMode: 0700 + fileMode: 0600 + +pubsub: + channels: + subscribe: to-bbb-webrtc-recorder + publish: from-bbb-webrtc-recorder + adapter: redis + adapters: + redis: + address: redis:6379 + network: tcp + #password: foobared + +webrtc: + rtcMinPort: 24577 + rtcMaxPort: 32768 + jitterBuffer: 512 + iceServers: + - urls: [] +# Example turn server +# - urls: +# - turn:turnserver.example.org:1234 +# username: webrtc +# credential: turnpassword + +# HTTP server for testing +# (should be disabled in production) +http: + port: 8080 + enable: false + +prometheus: + enable: false + listenAddress: 127.0.0.1:3200