docker/docker-compose.tmpl.yml
2024-01-07 23:54:28 +01:00

662 lines
19 KiB
YAML

{{/* if you read this, you can ignore the following lines */}}
# auto generated by ./scripts/generate-compose
# don't edit this directly.
{{/* -------- */}}
version: '3.6'
# html5 templates
x-html5-backend: &html5backend
build:
context: mod/html5
additional_contexts:
- source=./repos/bigbluebutton/bigbluebutton-html5
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
TAG_BBB: {{ .Env.TAG_BBB }}
image: alangecker/bbb-docker-html5:{{ .Env.TAG_BBB }}
restart: unless-stopped
depends_on:
- redis
- mongodb
- etherpad
environment: &html5backend-env
DOMAIN: ${DOMAIN}
CLIENT_TITLE: ${CLIENT_TITLE}
LISTEN_ONLY_MODE: ${LISTEN_ONLY_MODE:-true}
DISABLE_ECHO_TEST: ${DISABLE_ECHO_TEST:-false}
AUTO_SHARE_WEBCAM: ${AUTO_SHARE_WEBCAM:-false}
DISABLE_VIDEO_PREVIEW: ${DISABLE_VIDEO_PREVIEW:-false}
CHAT_ENABLED: ${CHAT_ENABLED:-true}
CHAT_START_CLOSED: ${CHAT_START_CLOSED:-false}
BREAKOUTROOM_LIMIT: ${BREAKOUTROOM_LIMIT:-8}
DEV_MODE: ${DEV_MODE:-}
BBB_HTML5_ROLE: backend
x-html5-frontend: &html5frontend
<<: *html5backend
volumes:
- html5-static:/html5-static:rw
environment: &html5frontend-env
<<: *html5backend-env
BBB_HTML5_ROLE: frontend
# =========================
services:
bbb-web:
build:
context: mod/bbb-web
additional_contexts:
- src-web=./repos/bigbluebutton/bigbluebutton-web
- src-common-message=./repos/bigbluebutton/bbb-common-message
- src-common-web=./repos/bigbluebutton/bbb-common-web
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
image: alangecker/bbb-docker-web:{{ .Env.TAG_BBB }}
restart: unless-stopped
depends_on:
- redis
- etherpad
- bbb-pads
healthcheck:
test: wget --no-proxy --no-verbose --tries=1 --spider http://10.7.7.2:8090/bigbluebutton/api || exit 1
start_period: 2m
environment:
DEV_MODE: ${DEV_MODE:-}
DOMAIN: ${DOMAIN}
ENABLE_RECORDING: ${ENABLE_RECORDING:-false}
SHARED_SECRET: ${SHARED_SECRET}
WELCOME_MESSAGE: ${WELCOME_MESSAGE:-}
WELCOME_FOOTER: ${WELCOME_FOOTER}
STUN_SERVER: stun:${STUN_IP}:${STUN_PORT}
TURN_SERVER: ${TURN_SERVER:-}
TURN_SECRET: ${TURN_SECRET:-}
ENABLE_LEARNING_DASHBOARD: ${ENABLE_LEARNING_DASHBOARD:-true}
NUMBER_OF_BACKEND_NODEJS_PROCESSES: {{ .Env.NUMBER_OF_BACKEND_NODEJS_PROCESSES }}
volumes:
- ./data/bigbluebutton:/var/bigbluebutton
- ./data/freeswitch-meetings:/var/freeswitch/meetings
networks:
bbb-net:
ipv4_address: 10.7.7.2
{{ if isTrue .Env.DEV_MODE }}
html5-dev:
build:
context: mod/html5
dockerfile: Dockerfile.dev
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
user: ${BBB_DOCKER_USER}
restart: unless-stopped
depends_on:
- redis
- mongodb
- etherpad
volumes:
- ./repos/bigbluebutton/bigbluebutton-html5:/app/:rw
- ./.cache/npm:/tmp/.npm:rw
- ./.cache/meteor:/tmp/.meteor:rw
- ./mod/html5/bbb-html5.yml:/tmp/bbb-html5.yml.tmpl
environment:
<<: *html5backend-env
HOME: /tmp
BBB_HTML5_ROLE: ""
networks:
bbb-net:
ipv4_address: 10.7.7.200
{{ else }}
{{ range $i := loop 0 (atoi .Env.NUMBER_OF_BACKEND_NODEJS_PROCESSES) }}
html5-backend-{{ add $i 1 }}:
<<: *html5backend
environment:
<<: *html5backend-env
INSTANCE_ID: {{ add $i 1 }}
PORT: {{ add 4000 $i }}
networks:
bbb-net:
ipv4_address: 10.7.7.{{ add 100 $i }}
{{end}}
{{ range $i := loop 0 (atoi .Env.NUMBER_OF_FRONTEND_NODEJS_PROCESSES) }}
html5-frontend-{{ add $i 1 }}:
<<: *html5frontend
environment:
<<: *html5frontend-env
INSTANCE_ID: {{ add $i 1 }}
PORT: {{ add 4100 $i }}
networks:
bbb-net:
ipv4_address: 10.7.7.{{ add 200 $i }}
{{end}}
{{ end }}
freeswitch:
container_name: bbb-freeswitch
build:
context: mod/freeswitch
additional_contexts:
- freeswitch=./repos/freeswitch/
- build-files=./repos/bigbluebutton/build/packages-template/bbb-freeswitch-core/
- fs-config=./repos/bigbluebutton/bbb-voice-conference/config/freeswitch/conf/
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
image: alangecker/bbb-docker-freeswitch:{{ .Env.TAG_FREESWITCH }}-{{ .Env.TAG_BBB }}
restart: unless-stopped
cap_add:
- IPC_LOCK
- NET_ADMIN
- NET_RAW
- NET_BROADCAST
- SYS_NICE
- SYS_RESOURCE
environment:
DOMAIN: ${DOMAIN}
EXTERNAL_IPv4: ${EXTERNAL_IPv4}
EXTERNAL_IPv6: ${EXTERNAL_IPv6:-::1}
SIP_IP_ALLOWLIST: ${SIP_IP_ALLOWLIST:-}
DISABLE_SOUND_MUTED: ${DISABLE_SOUND_MUTED:-false}
DISABLE_SOUND_ALONE: ${DISABLE_SOUND_ALONE:-false}
SOUNDS_LANGUAGE: ${SOUNDS_LANGUAGE:-en-us-callie}
ESL_PASSWORD: ${FSESL_PASSWORD:-ClueCon}
volumes:
- ./conf/sip_profiles:/etc/freeswitch/sip_profiles/external
- ./conf/dialplan_public:/etc/freeswitch/dialplan/public_docker
- ./data/freeswitch-meetings:/var/freeswitch/meetings
network_mode: host
logging:
# reduce logs to a minimum, so `docker compose logs -f` still works
driver: "local"
options:
max-size: "10k"
max-file: "1"
compress: "false"
nginx:
build:
context: mod/nginx
additional_contexts:
- src-learning-dashboard=./repos/bigbluebutton/bbb-learning-dashboard
- src-playback=./repos/bbb-playback
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
image: alangecker/bbb-docker-nginx:1.25-{{ .Env.TAG_PLAYBACK }}-{{ .Env.TAG_BBB }}
restart: unless-stopped
depends_on:
- etherpad
- webrtc-sfu
{{ if isTrue .Env.DEV_MODE }}
- html5-dev
{{ else }}
- html5-backend-1
{{ end }}
volumes:
- ./data/bigbluebutton:/var/bigbluebutton
- html5-static:/html5-static:ro
- ${DEFAULT_PRESENTATION:-/dev/null}:/www/default.pdf
{{ if isTrue .Env.DEV_MODE }}
# don't let nginx directly serve static files
- ./mod/nginx/bbb-html5.dev.nginx:/etc/nginx/bbb/bbb-html5.nginx:ro
{{ end }}
network_mode: host
extra_hosts:
- "host.docker.internal:10.7.7.1"
- "bbb-web:10.7.7.2"
- "etherpad:10.7.7.4"
- "webrtc-sfu:10.7.7.1"
- "html5:10.7.7.11"
- "greenlight:10.7.7.21"
etherpad:
build:
context: mod/etherpad
additional_contexts:
- plugin=./repos/bbb-etherpad-plugin
- skin=./repos/bbb-etherpad-skin
args:
TAG_ETHERPAD: "1.9.1"
image: alangecker/bbb-docker-etherpad:1.9.1-s{{ .Env.COMMIT_ETHERPAD_SKIN }}-p{{ .Env.COMMIT_ETHERPAD_PLUGIN }}
restart: unless-stopped
depends_on:
- redis
environment:
ETHERPAD_API_KEY: ${ETHERPAD_API_KEY}
networks:
bbb-net:
ipv4_address: 10.7.7.4
bbb-pads:
build:
context: mod/bbb-pads
additional_contexts:
- src=./repos/bbb-pads
image: alangecker/bbb-docker-pads:{{ .Env.TAG_PADS }}
restart: unless-stopped
depends_on:
- redis
- etherpad
environment:
ETHERPAD_API_KEY: ${ETHERPAD_API_KEY}
networks:
bbb-net:
ipv4_address: 10.7.7.18
redis:
image: redis:7.2-alpine
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 30
networks:
bbb-net:
ipv4_address: 10.7.7.5
mongodb:
image: mongo:6.0
restart: unless-stopped
volumes:
- ./mod/mongo/mongod.conf:/etc/mongod.conf
- ./mod/mongo/init-replica.sh:/docker-entrypoint-initdb.d/init-replica.sh
tmpfs:
- /data/configdb
- /data/db
command: mongod --config /etc/mongod.conf --oplogSize 8 --replSet rs0 --noauth
healthcheck:
test: bash -c "if mongo --eval 'quit(db.runCommand({ ping':' 1 }).ok ? 0 ':' 2)'; then exit 0; fi; exit 1;"
networks:
bbb-net:
ipv4_address: 10.7.7.6
webrtc-sfu:
build:
context: mod/webrtc-sfu
additional_contexts:
- source=./repos/bbb-webrtc-sfu
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
image: alangecker/bbb-docker-webrtc-sfu:{{ .Env.TAG_WEBRTC_SFU }}
restart: unless-stopped
depends_on:
- redis
- freeswitch
environment:
CLIENT_HOST: 10.7.7.1
REDIS_HOST: 10.7.7.5
FREESWITCH_IP: 10.7.7.1
FREESWITCH_SIP_IP: ${EXTERNAL_IPv4}
MCS_HOST: 0.0.0.0
MCS_ADDRESS: 0.0.0.0
ESL_IP: 10.7.7.1
ESL_PASSWORD: ${FSESL_PASSWORD:-ClueCon}
RECORDING_ADAPTER: bbb-webrtc-recorder
RECORD_WEBCAMS: "true"
KURENTO: '[]'
# TODO: add mediasoup IPv6
# TODO: can listen to 0.0.0.0 for nat support? https://github.com/versatica/mediasoup/issues/487
{{ if .Env.EXTERNAL_IPv6 }}
MS_WEBRTC_LISTEN_IPS: '[{"ip":"{{ .Env.EXTERNAL_IPv6 }}", "announcedIp":"{{ .Env.EXTERNAL_IPv6 }}"}, {"ip":"${EXTERNAL_IPv4}", "announcedIp":"${EXTERNAL_IPv4}"}]'
{{else}}
MS_WEBRTC_LISTEN_IPS: '[{"ip":"${EXTERNAL_IPv4}", "announcedIp":"${EXTERNAL_IPv4}"}]'
{{end}}
MS_RTP_LISTEN_IP: '{"ip":"0.0.0.0", "announcedIp":"${EXTERNAL_IPv4}"}'
volumes:
- ./data/mediasoup:/var/mediasoup
tmpfs:
- /var/log/bbb-webrtc-sfu
network_mode: host
fsesl-akka:
build:
context: mod/fsesl-akka
additional_contexts:
- src-common-message=./repos/bigbluebutton/bbb-common-message
- src-fsesl-client=./repos/bigbluebutton/bbb-fsesl-client
- src-fsesl-akka=./repos/bigbluebutton/akka-bbb-fsesl
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
image: alangecker/bbb-docker-fsesl-akka:{{ .Env.TAG_BBB }}
restart: unless-stopped
depends_on:
- redis
- freeswitch
environment:
FSESL_PASSWORD: ${FSESL_PASSWORD:-ClueCon}
networks:
bbb-net:
ipv4_address: 10.7.7.14
apps-akka:
build:
context: mod/apps-akka
additional_contexts:
- src-common-message=./repos/bigbluebutton/bbb-common-message
- src-apps-akka=./repos/bigbluebutton/akka-bbb-apps
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
image: alangecker/bbb-docker-apps-akka:{{ .Env.TAG_BBB }}
restart: unless-stopped
depends_on:
- redis
- postgres
environment:
DOMAIN: ${DOMAIN}
SHARED_SECRET: ${SHARED_SECRET}
POSTGRES_PASSWORD: ${POSTGRESQL_SECRET:-password}
volumes:
- ./data/freeswitch-meetings:/var/freeswitch/meetings
- ./conf/settings.yml:/etc/bigbluebutton/bbb-html5.yml:ro
networks:
bbb-net:
ipv4_address: 10.7.7.15
bbb-graphql-server:
build:
context: mod/bbb-graphql-server
additional_contexts:
- src=./repos/bigbluebutton/bbb-graphql-server
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
depends_on:
- postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRESQL_SECRET:-password}
networks:
bbb-net:
ipv4_address: 10.7.7.31
extra_hosts:
- "bbb-web:10.7.7.2"
- "bbb-graphql-actions:10.7.7.30"
bbb-graphql-actions:
build:
context: mod/bbb-graphql-actions
{{ if isTrue .Env.DEV_MODE }}
dockerfile: Dockerfile.dev
{{ else }}
additional_contexts:
- src=./repos/bigbluebutton/bbb-graphql-actions
{{ end }}
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
restart: unless-stopped
depends_on:
- redis
environment:
BBB_REDIS_HOST: redis
networks:
bbb-net:
ipv4_address: 10.7.7.30
{{ if isTrue .Env.DEV_MODE }}
volumes:
- ./repos/bigbluebutton/bbb-graphql-actions:/app/:rw
- ./.cache/npm:/tmp/.npm:rw
{{ end }}
bbb-graphql-middleware:
build:
context: mod/bbb-graphql-middleware
additional_contexts:
- src=./repos/bigbluebutton/bbb-graphql-middleware
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
restart: unless-stopped
depends_on:
- bbb-graphql-server
- redis
environment:
BBB_GRAPHQL_MIDDLEWARE_LISTEN_PORT: 8378
BBB_GRAPHQL_MIDDLEWARE_REDIS_ADDRESS: 10.7.7.5:6379
BBB_GRAPHQL_MIDDLEWARE_HASURA_WS: ws://bbb-graphql-server:8080/v1/graphql
networks:
bbb-net:
ipv4_address: 10.7.7.32
jodconverter:
build: mod/jodconverter
image: alangecker/bbb-docker-jodconverter:latest
security_opt:
- 'no-new-privileges:true'
restart: unless-stopped
tmpfs:
- /tmp
deploy:
resources:
limits:
memory: 512M
networks:
bbb-net:
ipv4_address: 10.7.7.20
periodic:
build: mod/periodic
image: alangecker/bbb-docker-periodic:v2.7.0
restart: unless-stopped
depends_on:
- mongodb
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data/bigbluebutton:/var/bigbluebutton
- ./data/mediasoup:/var/mediasoup
tmpfs:
- /var/log/bigbluebutton
environment:
ENABLE_RECORDING: ${ENABLE_RECORDING}
REMOVE_OLD_RECORDING: ${REMOVE_OLD_RECORDING}
RECORDING_MAX_AGE_DAYS: ${RECORDING_MAX_AGE_DAYS}
networks:
bbb-net:
ipv4_address: 10.7.7.12
{{ if isTrue .Env.ENABLE_RECORDING }}
# recordings
recordings:
build:
context: mod/recordings
additional_contexts:
- record-core=./repos/bigbluebutton/record-and-playback/core
- presentation=./repos/bigbluebutton/record-and-playback/presentation
- bbb-conf=./repos/bigbluebutton/bigbluebutton-config
args:
BBB_BUILD_TAG: {{ .Env.BBB_BUILD_TAG }}
TAG_BBB_PRESENTATION_VIDEO: "4.0.3"
image: alangecker/bbb-docker-recordings:{{ .Env.TAG_BBB }}
restart: unless-stopped
depends_on:
- redis
- bbb-pads
environment:
DOMAIN: ${DOMAIN}
SHARED_SECRET: ${SHARED_SECRET}
volumes:
- ./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 }}
# webhooks
webhooks:
build:
context: mod/webhooks
additional_contexts:
- src=./repos/bbb-webhooks
image: alangecker/bbb-docker-webhooks:{{ .Env.TAG_WEBHOOKS }}
restart: unless-stopped
environment:
DOMAIN: ${DOMAIN}
SHARED_SECRET: ${SHARED_SECRET}
depends_on:
- redis
networks:
bbb-net:
ipv4_address: 10.7.7.17
{{end}}
{{ if isTrue .Env.ENABLE_HTTPS_PROXY }}
# https
https_proxy:
image: valian/docker-nginx-auto-ssl
restart: unless-stopped
volumes:
- ssl_data:/etc/resty-auto-ssl
{{ if .Env.EXTERNAL_IPv6 }}
- ./mod/https/site.conf:/etc/nginx/conf.d/bbb-docker.conf
{{else}}
- ./mod/https/site-ipv4only.conf:/etc/nginx/conf.d/bbb-docker.conf
{{end}}
{{ if isTrue .Env.DEV_MODE }}
# allow bbb api access without https
- ./mod/https/force-https.conf:/usr/local/openresty/nginx/conf/force-https.conf
{{end}}
environment:
{{ if isTrue .Env.DEV_MODE }}
ALLOWED_DOMAINS: ""
{{else}}
ALLOWED_DOMAINS: ${DOMAIN}
{{end}}
RESOLVER_ADDRESS: ${RESOLVER_ADDRESS:-9.9.9.9}
network_mode: host
{{end}}
{{ if isTrue .Env.ENABLE_COTURN }}
# coturn
coturn:
image: coturn/coturn:4.6-alpine
restart: unless-stopped
command:
- "--external-ip=${EXTERNAL_IPv4}/${EXTERNAL_IPv4}"
- "--external-ip=${EXTERNAL_IPv6:-::1}/${EXTERNAL_IPv6:-::1}"
- "--static-auth-secret=${TURN_SECRET}"
volumes:
{{ if isTrue .Env.ENABLE_HTTPS_PROXY }}
- ssl_data:/etc/resty-auto-ssl
{{else}}
- ${COTURN_TLS_CERT_PATH}:/tmp/cert.pem
- ${COTURN_TLS_KEY_PATH}:/tmp/key.pem
{{end}}
- ./mod/coturn/entrypoint.sh:/usr/local/bin/docker-entrypoint.sh
- ./mod/coturn/turnserver.conf:/etc/coturn/turnserver.conf
environment:
ENABLE_HTTPS_PROXY:
user: root
network_mode: host
{{end}}
{{ if isTrue .Env.ENABLE_GREENLIGHT }}
# greenlight
greenlight:
image: bigbluebutton/greenlight:v3.0.6.1
restart: unless-stopped
env_file: .env
depends_on:
- postgres
- redis
environment:
DATABASE_URL: postgres://postgres:${POSTGRESQL_SECRET:-password}@postgres:5432/greenlight-v3
REDIS_URL: redis://redis:6379
{{ if isTrue .Env.DEV_MODE }}
BIGBLUEBUTTON_ENDPOINT: http://10.7.7.1/bigbluebutton/api
{{else}}
BIGBLUEBUTTON_ENDPOINT: https://${DOMAIN}/bigbluebutton/api
{{end}}
BIGBLUEBUTTON_SECRET: ${SHARED_SECRET}
SECRET_KEY_BASE: ${RAILS_SECRET}
RELATIVE_URL_ROOT: /
volumes:
- ./data/greenlight:/usr/src/app/storage
networks:
bbb-net:
ipv4_address: 10.7.7.21
{{end}}
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_MULTIPLE_DATABASES: bbb_graphql,hasura_app,greenlight
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRESQL_SECRET:-password}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./data/postgres:/var/lib/postgresql/data
- ./mod/postgres/initdb.sh:/docker-entrypoint-initdb.d/initdb.sh
networks:
bbb-net:
ipv4_address: 10.7.7.22
{{ if isTrue .Env.ENABLE_PROMETHEUS_EXPORTER }}
# prometheus
prometheus-exporter:
image: greenstatic/bigbluebutton-exporter:latest
restart: unless-stopped
environment:
API_BASE_URL: http://10.7.7.1:48087/bigbluebutton/api/
API_SECRET: ${SHARED_SECRET}
RECORDINGS_METRICS_READ_FROM_DISK: "${ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION:-false}"
networks:
bbb-net:
ipv4_address: 10.7.7.33
{{ if isTrue .Env.ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION }}
volumes:
- ./data/bigbluebutton:/var/bigbluebutton:ro
{{end}}
# the exporter requires /etc/bigbluebutton/bigbluebutton-release
tmpfs:
- /etc/bigbluebutton:mode=777
entrypoint: sh -c 'echo "BIGBLUEBUTTON_RELEASE=2.7.3" > /etc/bigbluebutton/bigbluebutton-release && python server.py'
{{end}}
volumes:
html5-static:
{{ if isTrue .Env.ENABLE_HTTPS_PROXY }}
ssl_data:
{{end}}
networks:
bbb-net:
ipam:
driver: default
config:
- subnet: "10.7.7.0/24"