x-jitsi-env: &jitsi-env
  JWT_APP_ID: ${JITSI_APP_ID:-ulti}
  JWT_APP_SECRET: ${JITSI_APP_SECRET:-changeme-jwt-secret}
  JICOFO_AUTH_PASSWORD: ${JICOFO_AUTH_PASSWORD:-changeme}
  JVB_AUTH_PASSWORD: ${JVB_AUTH_PASSWORD:-changeme}
  JIGASI_XMPP_PASSWORD: ${JIGASI_XMPP_PASSWORD:-changeme}
  JIGASI_TRANSCRIBER_PASSWORD: ${JIGASI_TRANSCRIBER_PASSWORD:-changeme}
  XMPP_SERVER: jitsi-prosody
  TZ: Europe/Paris

services:
  jitsi-web:
    image: jitsi/web:stable-9823
    restart: unless-stopped
    environment:
      <<: *jitsi-env
      ENABLE_AUTH: "1"
      AUTH_TYPE: jwt
      JWT_ACCEPTED_ISSUERS: ulti
      JWT_ACCEPTED_AUDIENCES: ulti
      PUBLIC_URL: https://${DOMAIN:-localhost}/meet
      XMPP_DOMAIN: meet.jitsi
      XMPP_MUC_DOMAIN: muc.meet.jitsi
      XMPP_BOSH_URL_BASE: http://jitsi-prosody:5280
      ENABLE_TRANSCRIPTIONS: "1"
    networks:
      - ulti-net
    depends_on:
      jitsi-prosody:
        condition: service_started

  jitsi-prosody:
    image: jitsi/prosody:stable-9823
    restart: unless-stopped
    environment:
      <<: *jitsi-env
      ENABLE_AUTH: "1"
      AUTH_TYPE: jwt
      JWT_ACCEPTED_ISSUERS: ulti
      JWT_ACCEPTED_AUDIENCES: ulti
      XMPP_DOMAIN: meet.jitsi
      XMPP_MUC_DOMAIN: muc.meet.jitsi
      XMPP_INTERNAL_MUC_DOMAIN: internal-muc.meet.jitsi
      ENABLE_TRANSCRIPTIONS: "1"
    networks:
      - ulti-net

  jitsi-jicofo:
    image: jitsi/jicofo:stable-9823
    restart: unless-stopped
    environment:
      <<: *jitsi-env
      XMPP_DOMAIN: meet.jitsi
      XMPP_MUC_DOMAIN: muc.meet.jitsi
      XMPP_INTERNAL_MUC_DOMAIN: internal-muc.meet.jitsi
      ENABLE_TRANSCRIPTIONS: "1"
    networks:
      - ulti-net
    depends_on:
      - jitsi-prosody

  jitsi-jvb:
    image: jitsi/jvb:stable-9823
    restart: unless-stopped
    ports:
      - "10000:10000/udp"
    environment:
      <<: *jitsi-env
      XMPP_DOMAIN: meet.jitsi
      XMPP_INTERNAL_MUC_DOMAIN: internal-muc.meet.jitsi
      JVB_PORT: "10000"
      JVB_STUN_SERVERS: stun.l.google.com:19302
      PUBLIC_URL: https://${DOMAIN:-localhost}/meet
    networks:
      - ulti-net
    depends_on:
      - jitsi-prosody

  skynet:
    build:
      context: jitsi/skynet
      dockerfile: Dockerfile
    restart: unless-stopped
    environment:
      ENABLED_MODULES: streaming_whisper
      BYPASS_AUTHORIZATION: "1"
      WHISPER_MODEL_NAME: ${SKYNET_WHISPER_MODEL:-tiny}
      WHISPER_MODEL_PATH: /models/streaming-whisper
      BEAM_SIZE: "1"
    volumes:
      - skynet-models:/models
    networks:
      - ulti-net

  jitsi-jigasi:
    image: jitsi/jigasi:stable-9823
    restart: unless-stopped
    environment:
      <<: *jitsi-env
      XMPP_DOMAIN: meet.jitsi
      XMPP_MUC_DOMAIN: muc.meet.jitsi
      XMPP_INTERNAL_MUC_DOMAIN: internal-muc.meet.jitsi
      JIGASI_MODE: transcriber
      JIGASI_BREWERY_MUC: jigasibrewery
      JIGASI_ENABLE_SDES_SRTP: "0"
      ENABLE_TRANSCRIPTIONS: "1"
      JIGASI_TRANSCRIBER_CUSTOM_SERVICE: org.jitsi.jigasi.transcription.WhisperTranscriptionService
      JIGASI_TRANSCRIBER_WHISPER_URL: ws://skynet:8000/streaming-whisper/ws
      JIGASI_TRANSCRIBER_SEND_JSON: "true"
      JIGASI_TRANSCRIBER_BASE_URL: http://ultid:8080/api/v1/meet/transcripts/
    networks:
      - ulti-net
    depends_on:
      - jitsi-prosody
      - skynet

volumes:
  skynet-models:
