# This docker-compose requires host networking, which is only available on Linux
# This compose will not function correctly on Mac or Windows
services:
  caddy:
    image: livekit/caddyl4
    command: run --config /etc/caddy.yaml --adapter yaml
    restart: unless-stopped
    network_mode: "host"
    volumes:
      - ./caddy.yaml:/etc/caddy.yaml
      - ./caddy_data:/data
  livekit:
    image: livekit/livekit-server:latest
    command: --config /etc/livekit.yaml
    restart: unless-stopped
    network_mode: "host"
    environment:
      - LIVEKIT_CORS_ALLOWED_ORIGINS=https://agenda.grfgraph.com
    volumes:
      - ./livekit.yaml:/etc/livekit.yaml
      - /etc/letsencrypt:/etc/letsencrypt:ro 
  redis:
    image: redis:7-alpine
    command: redis-server /etc/redis.conf
    restart: unless-stopped
    network_mode: "host"
    volumes:
      - ./redis.conf:/etc/redis.conf
  egress:
    image: livekit/egress:v1.7.0
    restart: unless-stopped
    environment:
      - EGRESS_CONFIG_FILE=/etc/livekit-egress.yaml
      - EGRESS_API_BIND_ADDRESS=0.0.0.0:8085    # <<< ESSENCIAL
    volumes:
      - ./livekit-egress.yaml:/etc/livekit-egress.yaml
      - /var/www/html/quickmeet/reunioes/gravacoes:/out
    network_mode: "host"
    cap_add:
      - CAP_SYS_ADMIN




  ingress:
    image: livekit/ingress:latest
    restart: unless-stopped
    environment:
      - INGRESS_CONFIG_FILE=/etc/ingress.yaml
    network_mode: "host"
    volumes:
      - ./ingress.yaml:/etc/ingress.yaml
