version: '2'

services:
    # Frontend
    web:
        image: jitsi/web
        container_name: jitsi-web
        hostname: jitsi-web
        extra_hosts:
            - "meet.hatthieves.es:172.145.0.101"
            - "muc.hatthieves.es:172.145.0.102"
            - "internal-muc.hatthieves.es:172.145.0.102"
            - "guest.hatthieves.es:172.145.0.102"
            - "auth.hatthieves.es:172.145.0.102"
            - "xmpp.hatthieves.es:172.145.0.102"
            - "hatthieves.es:82.223.3.135"
        volumes:
            - ./jitsi/web/config:/config
#            - ./jitsi/transcripts:/usr/share/jitsi-meet/transcripts
        environment:
            - ENABLE_AUTH
            - ENABLE_GUESTS
            - ENABLE_LETSENCRYPT
            - ENABLE_HTTP_REDIRECT
            - ENABLE_TRANSCRIPTIONS
            - DISABLE_HTTPS
            - JICOFO_AUTH_USER
            - LETSENCRYPT_DOMAIN
            - LETSENCRYPT_EMAIL
            - PUBLIC_URL
            - XMPP_DOMAIN
            - XMPP_AUTH_DOMAIN
            - XMPP_BOSH_URL_BASE
            - XMPP_GUEST_DOMAIN
            - XMPP_MUC_DOMAIN
            - ETHERPAD_URL_BASE
            - TZ
        networks:            
          mynet:   
            ipv4_address: 172.145.0.101

    # XMPP server
    prosody:
        image: jitsi/prosody
        container_name: jitsi-prosody
        hostname: jitsi-prosody
        extra_hosts:
            - "meet.hatthieves.es:172.145.0.101"
            - "muc.hatthieves.es:172.145.0.102"
            - "internal-muc.hatthieves.es:172.145.0.102"
            - "guest.hatthieves.es:172.145.0.102"
            - "auth.hatthieves.es:172.145.0.102"
            - "xmpp.hatthieves.es:172.145.0.102"
            - "hatthieves.es:82.223.3.135"
#        ports:
#            - "5222:5222/tcp"
        expose:
            - 5222
            - 5347
            - 5280
        volumes:
#            - ./jitsi/prosody:/config
            - ./jitsi/prosody/certs/hatthieves.es.key:/config/certs/auth.hatthieves.es.key:ro
            - ./jitsi/prosody/certs/hatthieves.es.crt:/config/certs/auth.hatthieves.es.crt:ro
            - ./jitsi/prosody/certs/hatthieves.es.key:/config/certs/xmpp.hatthieves.es.key:ro
            - ./jitsi/prosody/certs/hatthieves.es.crt:/config/certs/xmpp.hatthieves.es.crt:ro
#            - ./jitsi/prosody/jitsi-meet.cfg.lua:/config/conf.d/jitsi-meet.cfg.lua:ro
        environment:
            - AUTH_TYPE
            - ENABLE_AUTH
            - ENABLE_GUESTS
            - GLOBAL_MODULES
            - GLOBAL_CONFIG
            - LDAP_URL
            - LDAP_BASE
            - LDAP_BINDDN
            - LDAP_BINDPW
            - LDAP_FILTER
            - LDAP_AUTH_METHOD
            - LDAP_VERSION
            - LDAP_USE_TLS
            - LDAP_TLS_CIPHERS
            - LDAP_TLS_CHECK_PEER
            - LDAP_TLS_CACERT_FILE
            - LDAP_TLS_CACERT_DIR
            - XMPP_DOMAIN
            - XMPP_AUTH_DOMAIN
            - XMPP_GUEST_DOMAIN
            - XMPP_MUC_DOMAIN
            - XMPP_INTERNAL_MUC_DOMAIN
            - XMPP_MODULES
            - XMPP_MUC_MODULES
            - XMPP_INTERNAL_MUC_MODULES
            - JICOFO_COMPONENT_SECRET
            - JICOFO_AUTH_USER
            - JICOFO_AUTH_PASSWORD
            - JVB_AUTH_USER
            - JVB_AUTH_PASSWORD
            - JIGASI_XMPP_USER
            - JIGASI_XMPP_PASSWORD
            - JWT_APP_ID
            - JWT_APP_SECRET
            - JWT_ACCEPTED_ISSUERS
            - JWT_ACCEPTED_AUDIENCES
            - JWT_ASAP_KEYSERVER
            - JWT_ALLOW_EMPTY
            - JWT_AUTH_TYPE
            - JWT_TOKEN_AUTH_MODULE
            - LOG_LEVEL
            - TZ
        networks:            
          mynet:   
            ipv4_address: 172.145.0.102

    # Focus component
    jicofo:
        image: jitsi/jicofo
        container_name: jitsi-jicofo
        hostname: jitsi-jicofo
        extra_hosts:
            - "meet.hatthieves.es:172.145.0.101"
            - "muc.hatthieves.es:172.145.0.102"
            - "internal-muc.hatthieves.es:172.145.0.102"
            - "guest.hatthieves.es:172.145.0.102"
            - "auth.hatthieves.es:172.145.0.102"
            - "xmpp.hatthieves.es:172.145.0.102"
            - "hatthieves.es:82.223.3.135"
#        volumes:
#            - ./jitsi/jicofo:/config
#            - ./jitsi/prosody/certs/hatthieves.es.crt:/usr/local/share/ca-certificates/auth.hatthieves.es.crt:ro
        environment:
            - ENABLE_AUTH
            - XMPP_DOMAIN
            - XMPP_AUTH_DOMAIN
            - XMPP_INTERNAL_MUC_DOMAIN
            - XMPP_SERVER
            - JICOFO_COMPONENT_SECRET
            - JICOFO_AUTH_USER
            - JICOFO_AUTH_PASSWORD
            - JVB_BREWERY_MUC
            - JIGASI_BREWERY_MUC
            - TZ
        depends_on:
            - prosody
        networks:            
          mynet:   
            ipv4_address: 172.145.0.103

    # Video bridge
    jvb:
        image: jitsi/jvb
        container_name: jitsi-jvb
        hostname: jitsi-jvb
        extra_hosts:
            - "meet.hatthieves.es:172.145.0.101"
            - "muc.hatthieves.es:172.145.0.102"
            - "internal-muc.hatthieves.es:172.145.0.102"
            - "guest.hatthieves.es:172.145.0.102"
            - "auth.hatthieves.es:172.145.0.102"
            - "xmpp.hatthieves.es:172.145.0.102"
            - "hatthieves.es:82.223.3.135"
        ports:
            - '${JVB_PORT}:${JVB_PORT}/udp'
            - '${JVB_TCP_PORT}:${JVB_TCP_PORT}'
#        volumes:
#            - ./jitsi/jvb/sip-communicator.properties:/config/sip-communicator.properties
#            - ./jitsi/jvb/config:/etc/jitsi/videobridge/config:ro
        environment:
            - DOCKER_HOST_ADDRESS
            - XMPP_AUTH_DOMAIN
            - XMPP_INTERNAL_MUC_DOMAIN
            - XMPP_SERVER
            - JVB_AUTH_USER
            - JVB_AUTH_PASSWORD
            - JVB_BREWERY_MUC
            - JVB_PORT
            - JVB_HOSTNAME
            - JVB_TCP_HARVESTER_DISABLED
            - JVB_TCP_PORT
            - JVB_STUN_SERVERS
            - JVB_ENABLE_APIS
            - JICOFO_AUTH_USER
            - TZ
        depends_on:
            - prosody
        networks:            
          mynet:   
            ipv4_address: 172.145.0.104

    # SIP gateway (audio)
    jigasi:
        image: jitsi/jigasi
        container_name: jitsi-jigasi
        hostname: jitsi-jigasi
        extra_hosts:
            - "meet.hatthieves.es:172.145.0.101"
            - "muc.hatthieves.es:172.145.0.102"
            - "internal-muc.hatthieves.es:172.145.0.102"
            - "guest.hatthieves.es:172.145.0.102"
            - "xmpp.hatthieves.es:172.145.0.102"
            - "auth.hatthieves.es:172.145.0.102"
            - "hatthieves.es:82.223.3.135"
        ports:
            - '${JIGASI_PORT_MIN}-${JIGASI_PORT_MAX}:${JIGASI_PORT_MIN}-${JIGASI_PORT_MAX}/udp'
#        volumes:
#            - ./jitsi/jigasi/sip-communicator.properties:/config/sip-communicator.properties:ro
#            - ./jitsi/transcripts:/tmp/transcripts
        environment:
            - ENABLE_AUTH
            - XMPP_AUTH_DOMAIN
            - XMPP_INTERNAL_MUC_DOMAIN
            - XMPP_SERVER
            - XMPP_DOMAIN
            - PUBLIC_URL
            - JIGASI_SIP_URI
            - JIGASI_SIP_PASSWORD
            - JIGASI_SIP_SERVER
            - JIGASI_SIP_PORT
            - JIGASI_SIP_TRANSPORT
            - JIGASI_XMPP_USER
            - JIGASI_XMPP_PASSWORD
            - JIGASI_BREWERY_MUC
            - JIGASI_PORT_MIN
            - JIGASI_PORT_MAX
            - JIGASI_HEALTH_CHECK_SIP_URI
            - JIGASI_HEALTH_CHECK_INTERVAL
            - JIGASI_SIP_KEEP_ALIVE_METHOD
            - JIGASI_ENABLE_SDES_SRTP
            - ENABLE_TRANSCRIPTIONS
            - JIGASI_TRANSCRIBER_ADVERTISE_URL
            - JIGASI_TRANSCRIBER_RECORD_AUDIO
            - JIGASI_TRANSCRIBER_SEND_TXT
            - GOOGLE_APPLICATION_CREDENTIALS
            - TZ
        depends_on:
            - prosody
        networks:
          mynet:   
            ipv4_address: 172.145.0.105


#    jibri:
#        image: jitsi/jibri
#        container_name: jitsi-jibri
#        hostname: jitsi-jibri
#        extra_hosts:
#            - "meet.hatthieves.es:172.145.0.101"
#            - "muc.hatthieves.es:172.145.0.102"
#            - "internal-muc.hatthieves.es:172.145.0.102"
#            - "guest.hatthieves.es:172.145.0.102"
#            - "xmpp.hatthieves.es:172.145.0.102"
#            - "auth.hatthieves.es:172.145.0.102"
#            - "hatthieves.es:82.223.3.135"
#        volumes:
##            - ${CONFIG}/jibri:/config
#            - /dev/shm:/dev/shm
#        cap_add:
#            - SYS_ADMIN
#            - NET_BIND_SERVICE
#        devices:
#            - /dev/snd:/dev/snd
#        environment:
#            - XMPP_AUTH_DOMAIN
#            - XMPP_INTERNAL_MUC_DOMAIN
#            - XMPP_RECORDER_DOMAIN
#            - XMPP_SERVER
#            - XMPP_DOMAIN
#            - JIBRI_XMPP_USER
#            - JIBRI_XMPP_PASSWORD
#            - JIBRI_BREWERY_MUC
#            - JIBRI_RECORDER_USER
#            - JIBRI_RECORDER_PASSWORD
#            - JIBRI_RECORDING_DIR
#            - JIBRI_FINALIZE_RECORDING_SCRIPT_PATH
#            - JIBRI_STRIP_DOMAIN_JID
#            - JIBRI_LOGS_DIR
#            - DISPLAY=:0
#            - TZ
#        depends_on:
#            - jicofo
#        networks:
#          mynet:   
#            ipv4_address: 172.145.0.106

networks:
  mynet:
    driver: bridge
    ipam:
      config:
      - subnet: 172.145.0.0/24

