# Jitsi Meet Docker Compose for SecuBox
# Based on https://github.com/jitsi/docker-jitsi-meet

version: '3.5'

services:
  # Frontend web server
  web:
    image: jitsi/web:${JITSI_IMAGE_VERSION:-stable}
    container_name: jitsi-web
    restart: unless-stopped
    ports:
      - '${HTTP_PORT:-8000}:80'
      - '${HTTPS_PORT:-8443}:443'
    volumes:
      - ${CONFIG}/web:/config:Z
      - ${CONFIG}/transcripts:/usr/share/jitsi-meet/transcripts:Z
    environment:
      - ENABLE_AUTH
      - ENABLE_GUESTS
      - ENABLE_LOBBY
      - ENABLE_PREJOIN_PAGE
      - ENABLE_WELCOME_PAGE
      - ENABLE_BREAKOUT_ROOMS
      - ENABLE_REACTIONS
      - ENABLE_NOISY_MIC_DETECTION
      - ENABLE_TALK_WHILE_MUTED
      - DEFAULT_LANGUAGE
      - PUBLIC_URL
      - TZ
      - XMPP_AUTH_DOMAIN
      - XMPP_BOSH_URL_BASE
      - XMPP_DOMAIN
      - XMPP_GUEST_DOMAIN
      - XMPP_MUC_DOMAIN
    networks:
      meet.jitsi:
        aliases:
          - ${XMPP_DOMAIN}

  # XMPP server
  prosody:
    image: jitsi/prosody:${JITSI_IMAGE_VERSION:-stable}
    container_name: jitsi-prosody
    restart: unless-stopped
    expose:
      - '5222'
      - '5347'
      - '5280'
    volumes:
      - ${CONFIG}/prosody/config:/config:Z
      - ${CONFIG}/prosody/prosody-plugins-custom:/prosody-plugins-custom:Z
    environment:
      - AUTH_TYPE
      - ENABLE_AUTH
      - ENABLE_GUESTS
      - ENABLE_LOBBY
      - ENABLE_XMPP_WEBSOCKET
      - JICOFO_AUTH_USER
      - JICOFO_AUTH_PASSWORD
      - JICOFO_COMPONENT_SECRET
      - JVB_AUTH_USER
      - JVB_AUTH_PASSWORD
      - JWT_APP_ID
      - JWT_APP_SECRET
      - JWT_ACCEPTED_ISSUERS
      - JWT_ACCEPTED_AUDIENCES
      - PUBLIC_URL
      - TZ
      - XMPP_DOMAIN
      - XMPP_AUTH_DOMAIN
      - XMPP_GUEST_DOMAIN
      - XMPP_MUC_DOMAIN
      - XMPP_INTERNAL_MUC_DOMAIN
    networks:
      meet.jitsi:
        aliases:
          - ${XMPP_SERVER:-xmpp.meet.jitsi}

  # Conference focus
  jicofo:
    image: jitsi/jicofo:${JITSI_IMAGE_VERSION:-stable}
    container_name: jitsi-jicofo
    restart: unless-stopped
    volumes:
      - ${CONFIG}/jicofo:/config:Z
    environment:
      - AUTH_TYPE
      - ENABLE_AUTH
      - ENABLE_AUTO_OWNER
      - JICOFO_AUTH_USER
      - JICOFO_AUTH_PASSWORD
      - JICOFO_ENABLE_BRIDGE_HEALTH_CHECKS
      - JICOFO_ENABLE_HEALTH_CHECKS
      - JVB_BREWERY_MUC
      - TZ
      - XMPP_DOMAIN
      - XMPP_AUTH_DOMAIN
      - XMPP_INTERNAL_MUC_DOMAIN
      - XMPP_MUC_DOMAIN
      - XMPP_SERVER
    depends_on:
      - prosody
    networks:
      meet.jitsi:

  # Video bridge (SFU)
  jvb:
    image: jitsi/jvb:${JITSI_IMAGE_VERSION:-stable}
    container_name: jitsi-jvb
    restart: unless-stopped
    ports:
      - '${JVB_PORT:-10000}:${JVB_PORT:-10000}/udp'
      - '127.0.0.1:8080:8080'
    volumes:
      - ${CONFIG}/jvb:/config:Z
    environment:
      - DOCKER_HOST_ADDRESS
      - ENABLE_COLIBRI_WEBSOCKET
      - JVB_AUTH_USER
      - JVB_AUTH_PASSWORD
      - JVB_BREWERY_MUC
      - JVB_PORT
      - JVB_STUN_SERVERS
      - JVB_ENABLE_APIS
      - PUBLIC_URL
      - TZ
      - XMPP_AUTH_DOMAIN
      - XMPP_INTERNAL_MUC_DOMAIN
      - XMPP_SERVER
    depends_on:
      - prosody
    networks:
      meet.jitsi:

networks:
  meet.jitsi:
    driver: bridge
