services:
  nginx:
    environment:
    - IVR_INSTALLED

    volumes:
    - ivr-assets:/usr/share/ivr

  webi:
    environment:
    - IVR_INSTALLED

  ivrweb:
    image: "xivoxc/xivo-ivrweb:${XIVOCC_TAG}.${XIVOCC_DIST}"

    environment:
      - DB_USER=asterisk
      - DB_PASSWORD=proformatique

    ports:
      - "127.0.0.1:9101:9000/tcp"

    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - ivr-assets:/app/web/assets
      - /var/lib/xivo/ivrsounds:/var/lib/xivo/ivrsounds
    
    extra_hosts:
      - xivohost:${XIVO_HOST}
      
    restart: always

  ivragi:
    image: "xivoxc/xivo-ivragi:${XIVOCC_TAG}.${XIVOCC_DIST}"

    environment:
      - DB_USER=asterisk
      - DB_PASSWORD=proformatique

    ports:
      - "127.0.0.1:4574:4573/tcp"
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /var/lib/xivo/ivrsounds:/var/lib/xivo/ivrsounds

    restart: always
    
volumes:
  ivr-assets:
  
