services:
  elk:
    image: "comodoitsm/op-elk:1.4.1"
    networks:
      - itsm
    volumes:
      - "/opt/itsm/elk/elasticsearch:/var/lib/elasticsearch"
    restart: always
  web:
    image: "comodoitsm/op-web:6.28.26701.19061.2"
    ports:
      - 443:443
      - 80:80
    networks:
      - itsm
    depends_on:
      - postgres
      - mail
      - ms_rebranding
      - redis
      - ms_cherga
      - memcache
    volumes:
      - "/opt/itsm/web/runtime:/var/www/mdm/src/protected/runtime"
      - "/opt/itsm/web/certs:/etc/nginx/certs"
      - "/opt/itsm/verdict-db:/usr/src/app/storage"
      - "itsm-web-assets:/var/www/mdm/assets"
    environment:
      - ITSM_DOMAIN
      - ITSM_XMPP_HOST
      - ITSM_XMPP_IP
      - ITSM_RMM_IP
      - ITSM_WEB_IP
      - ITSM_PLUGINS_IP
      - ITSM_SMTP_HOST
      - ITSM_SMTP_AUTH
      - ITSM_SMTP_LOGIN
      - ITSM_SMTP_PASSWORD
      - ITSM_SMTP_FROM
      - ITSM_SMTP_FROM_NAME
      - ITSM_TURN_SERVERS
      - ITSM_TURN_SECRET=itsm-turn-secret
      - ITSM_DEBUG
      - BIP_PUBLIC_SUBDOMAIN=bip
      - ITSM_KIBANA_BA_PASS
      - ITSM_RABBIT_BA_PASS
      - ITSM_CONSUL_BA_PASS
      - ITSM_ONPREMISE_BUILD_VERSION=1.3
      - ITSM_WEB_BUILD_SOURCE=comodoitsm/op-web
      - ITSM_WEB_BUILD_VERSION=6.28.26701.19061.2
      - ITSM_CONSUL_BUILD_SOURCE=comodoitsm/op-consul
      - ITSM_CONSUL_BUILD_VERSION=1.2.9
      - ITSM_MS_DC_BUILD_VERSION=1.3.17
      - ITSM_MS_DC_BUILD_SOURCE=comodoitsm/op-ms-dc
      - ITSM_MS_CUSTOMER_BUILD_VERSION=2.1.10
      - ITSM_MS_CUSTOMER_BUILD_SOURCE=comodoitsm/op-ms-customer
      - ITSM_MS_COMPANY_BUILD_VERSION=2.0.6
      - ITSM_MS_COMPANY_BUILD_SOURCE=comodoitsm/op-ms-company
      - ITSM_MS_DEVICE_BUILD_VERSION=2.0.12
      - ITSM_MS_DEVICE_BUILD_SOURCE=comodoitsm/op-ms-device
      - ITSM_MS_FR_BUILD_VERSION=1.3.12
      - ITSM_MS_FR_BUILD_SOURCE=comodoitsm/op-ms-fr
      - ITSM_MS_FR_UI_BUILD_VERSION=2.1.31
      - ITSM_MS_FR_UI_BUILD_SOURCE=comodoitsm/op-ms-fr-ui
      - ITSM_MS_FR_TASKER_BUILD_VERSION=1.1.0-2
      - ITSM_MS_FR_TASKER_BUILD_SOURCE=comodoitsm/op-ms-fr-tasker
      - ITSM_MS_AUDIT_LOG_BUILD_VERSION=1.5.20
      - ITSM_MS_AUDIT_LOG_BUILD_SOURCE=comodoitsm/op-ms-al
      - ITSM_MS_AUDIT_LOG_TASKER_BUILD_VERSION=1.1.1
      - ITSM_MS_AUDIT_LOG_TASKER_BUILD_SOURCE=comodoitsm/op-ms-al-tasker
      - ITSM_MS_GLOBAL_FILE_EVENT_BUILD_VERSION=2.4.35
      - ITSM_MS_GLOBAL_FILE_EVENT_BUILD_SOURCE=comodoitsm/op-ms-gfe
      - ITSM_MS_REPORTS_CSV_BUILD_VERSION=1.2.9
      - ITSM_MS_REPORTS_CSV_BUILD_SOURCE=comodoitsm/op-ms-report
      - ITSM_MS_REBRANDING_BUILD_VERSION=1.0.11
      - ITSM_MS_REBRANDING_BUILD_SOURCE=comodoitsm/op-rcc-gen
      - ITSM_MS_RMM_COLLECTOR_BUILD_VERSION=2.0.16
      - ITSM_MS_RMM_COLLECTOR_BUILD_SOURCE=comodoitsm/op-ms-rmm-collector
      - ITSM_MS_RMM_COLLECTOR_UI_BUILD_VERSION=2.1.0
      - ITSM_MS_RMM_COLLECTOR_UI_BUILD_SOURCE=comodoitsm/op-ms-rmm-collector-ui
      - ITSM_MS_RMM_SEARCHER_BUILD_VERSION=2.1.4
      - ITSM_MS_RMM_SEARCHER_BUILD_SOURCE=comodoitsm/op-ms-rmm-searcher
      - ITSM_MS_AUTH_CACHED_PROXY_BUILD_VERSION=1.1.14
      - ITSM_MS_AUTH_CACHED_PROXY_BUILD_SOURCE=comodoitsm/op-ms-auth-cached-proxy
      - ITSM_MS_RTDC_API_BUILD_VERSION=1.13.2
      - ITSM_MS_RTDC_API_BUILD_SOURCE=comodoitsm/op-ms-rtdc-api
      - ITSM_MS_RTDC_RELAY_BUILD_VERSION=2.0.63
      - ITSM_MS_RTDC_RELAY_BUILD_SOURCE=comodoitsm/op-ms-rtdc-relay
      - ITSM_MS_BIP_BUILD_VERSION=2.3.8
      - ITSM_MS_BIP_BUILD_SOURCE=comodoitsm/op-ms-bip
      - ITSM_MS_CHERGA_BUILD_VERSION=1.7.7
      - ITSM_MS_CHERGA_BUILD_SOURCE=comodoitsm/op-ms-cherga
      - ITSM_MS_TASKER_BUILD_VERSION=1.5.13
      - ITSM_MS_TASKER_BUILD_SOURCE=comodoitsm/op-ms-tasker
      - ITSM_STAT_BUILD_VERSION=1.0.2
      - ITSM_STAT_BUILD_SOURCE=comodoitsm/op-stat
      - ITSM_STAT_EXPORTER_BUILD_VERSION=0.0.4
      - ITSM_STAT_EXPORTER_BUILD_SOURCE=comodoitsm/op-stats-exporter
      - ITSM_BIN_WIN_CRC_BUILD_VERSION=6.28.26587.19060
      - ITSM_BIN_WIN_CRC_BUILD_SOURCE=comodoitsm/op-bin-win-crc
      - ITSM_BIN_OSX_BUILD_VERSION=6.28.26609.19060
      - ITSM_BIN_OSX_BUILD_SOURCE=comodoitsm/op-bin-osx-crc
      - ITSM_BIN_AV_DB_BUILD_VERSION=1.0.20190620
      - ITSM_BIN_AV_DB_BUILD_SOURCE=comodoitsm/op-bin-av-db
      - ITSM_BIN_CDN_BUILD_VERSION=1.1.20190619
      - ITSM_BIN_CDN_BUILD_SOURCE=comodoitsm/op-bin-cdn
      - ITSM_BE_MIGRATOR_BUILD_VERSION=0.0.4
      - ITSM_BE_MIGRATOR_BUILD_SOURCE=comodoitsm/op-pm-spm-migrator
      - ITSM_BE_ADMIN_BUILD_VERSION=0.0.6
      - ITSM_BE_ADMIN_BUILD_SOURCE=comodoitsm/op-pm-spm-admin-portal
      - ITSM_BE_PM_SERVICE_BUILD_VERSION=1.6.21
      - ITSM_BE_PM_SERVICE_BUILD_SOURCE=comodoitsm/op-be-pm-service
      - ITSM_BE_PM_CONSUMER_BUILD_VERSION=2.3.23
      - ITSM_BE_PM_CONSUMER_BUILD_SOURCE=comodoitsm/op-be-pm-consumer
    restart: always
  redis:
    image: "redis:5.0.2"
    restart: always
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
    networks:
      - itsm
    volumes:
      - "/opt/itsm/redis:/data"
  memcache:
    image: "memcached:1.5.14"
    restart: always
    networks:
      - itsm
  postgres:
    image: "postgres:9.6.11"
    restart: always
    environment:
      POSTGRES_PASSWORD: postgres
    volumes:
      - "/opt/itsm/postgres:/var/lib/postgresql/data"
    networks:
      - itsm
  mail:
    image: "namshi/smtp:latest"
    networks:
      - itsm
    restart: always
  rabbit:
    image: "rabbitmq:3.7.8-management"
    environment:
      RABBITMQ_DEFAULT_USER: itsm
      RABBITMQ_DEFAULT_PASS: itsm
    networks:
      - itsm
    hostname: itsm-rabbit
    restart: always
  consul:
    image: "comodoitsm/op-consul:1.2.9"
    hostname: consul
    networks:
      - itsm
    environment:
      - ITSM_DOMAIN
    volumes:
      - "/opt/itsm/consul/config:/consul/config"
      - "/opt/itsm/consul/data:/consul/data"
    restart: always
  mongo:
    image: "mongo:3.4.10"
    networks:
      - itsm
    volumes:
      - "/opt/itsm/mongo/data:/data/db"
    restart: always
  ms_dc:
    image: "comodoitsm/op-ms-dc:1.3.17"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
    environment:
      ITSM_SERVICE_START_DELAY: 40
    restart: always
  ms_customer:
    image: "comodoitsm/op-ms-customer:2.1.10"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
    environment:
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_START_DELAY: 40
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
  ms_company:
    image: "comodoitsm/op-ms-company:2.0.6"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
      - postgres
    environment:
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_START_DELAY: 40
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
  ms_device:
    image: "comodoitsm/op-ms-device:2.0.12"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
      - postgres
    environment:
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_START_DELAY: 40
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
  ms_fr:
    image: "comodoitsm/op-ms-fr:1.3.12"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
      - mongo
    environment:
      ITSM_SERVICE_START_DELAY: 40
    volumes:
      - "/opt/itsm/verdict-db:/usr/src/app/storage"
    restart: always
  ms_fr_ui:
    image: "comodoitsm/op-ms-fr-ui:2.1.31"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
    environment:
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
  ms_fr_tasker:
    image: "comodoitsm/op-ms-fr-tasker:1.1.0-2"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
      - mongo
    restart: always
  ms_audit_log:
    image: "comodoitsm/op-ms-al:1.5.20"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
      - elk
    environment:
      ITSM_SERVICE_START_DELAY: 40
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
    command: >
      /bin/bash -c "
        sleep 60;
        /bin/bash /bootstrap.sh
      "
  ms_audit_log_tasker:
    image: "comodoitsm/op-ms-al-tasker:1.1.1"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
      - elk
    restart: always
  ms_global_file_event:
    image: "comodoitsm/op-ms-gfe:2.4.35"
    environment:
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_RESOLVER: "docker"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
      - mongo
    restart: always
  ms_reports_csv:
    image: "comodoitsm/op-ms-report:1.2.9"
    volumes:
      - "itsm-web-assets:/var/downloads"
    networks:
      - itsm
    depends_on:
      - consul
      - rabbit
      - web
    extra_hosts:
      - "${ITSM_WEB_HOST}:${ITSM_WEB_IP}"
    environment:
      ITSM_ENV: itsm
      ITSM_CONFIG_MANAGER: consul
      ITSM_CONSUL_URI: http://consul:8500
      ITSM_DOMAIN: ${ITSM_DOMAIN}
      ITSM_WEB_IP: ${ITSM_WEB_IP}
      ITSM_SERVICE_START_DELAY: 40
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
    command: >
      /bin/bash -c "
        sleep 40;
        /bin/bash /on-premise-bootstrap.sh
      "
  ms_rebranding:
    image: "comodoitsm/op-rcc-gen:1.0.11"
    networks:
      - itsm
    depends_on:
      - consul
    restart: always
    command: >
      /bin/bash -c "
        sleep 40;
        /bin/bash /bootstrap.sh
      "
  ms_rmm_collector:
    image: "comodoitsm/op-ms-rmm-collector:2.0.16"
    networks:
      - itsm
    environment:
      ITSM_SERVICE_START_DELAY: 40
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
    depends_on:
      - consul
    extra_hosts:
      - "${ITSM_WEB_HOST}:${ITSM_WEB_IP}"
    command: >
      /bin/bash -c "
        sleep 60;
        /bin/bash /bootstrap.sh
      "
  ms_rmm_collector_ui:
    image: "comodoitsm/op-ms-rmm-collector-ui:2.1.0"
    networks:
      - itsm
    environment:
      ITSM_SERVICE_START_DELAY: 40
      ITSM_LOG_STDOUT_DISABLED: "true"
      ITSM_LOG_INTERNAL_ENABLED: "true"
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_RESOLVER: "docker"
    depends_on:
      - consul
    extra_hosts:
      - "${ITSM_WEB_HOST}:${ITSM_WEB_IP}"
    restart: always
    command: >
      /bin/bash -c "
        sleep 60;
        /bin/bash /bootstrap.sh
      "
  ms_rmm_searcher:
    image: "comodoitsm/op-ms-rmm-searcher:2.1.4"
    networks:
      - itsm
    depends_on:
      - consul
    environment:
      ITSM_SERVICE_START_DELAY: 40
      ITSM_LOG_STDOUT_DISABLED: "true"
      ITSM_LOG_INTERNAL_ENABLED: "true"
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
    command: >
      /bin/bash -c "
        sleep 60;
        /bin/bash /bootstrap.sh
      "
  ms_auth_cached_proxy:
    image: "comodoitsm/op-ms-auth-cached-proxy:1.1.14"
    networks:
      - itsm
    depends_on:
      - web
      - consul
    environment:
      ITSM_ENV: itsm
      ITSM_DOMAIN: ${ITSM_DOMAIN}
      ITSM_SERVICE_RESOLVER: "docker"
      ITSM_SERVICE_START_DELAY: 40
    entrypoint: /on-premise-bootstrap.sh
    restart: always
  ms_rtdc_api:
    image: "comodoitsm/op-ms-rtdc-api:1.13.2"
    networks:
      - itsm
    depends_on:
      - redis
    environment:
      ITSM_ENV: itsm
      ITSM_DOMAIN: ${ITSM_DOMAIN}
      ITSM_CONSUL_URI: http://consul:8500
      ITSM_MS_NODE_ID: "01"
      ITSM_CA_CERT_PATH:
      ITSM_SERVICE_RESOLVER: "docker"
      ITSM_SERVICE_START_DELAY: 40
    extra_hosts:
      - "${ITSM_XMPP_HOST}:${ITSM_XMPP_IP}"
      - "${ITSM_WEB_HOST}:${ITSM_WEB_IP}"
    command: >
      /bin/bash -c "
        sleep 40;
        /bin/bash /on-premise-bootstrap.sh
      "
    restart: always
    volumes:
      - "/opt/itsm/rtdc-api/certs:/opt/certs"
  ms_rtdc_relay:
    image: "comodoitsm/op-ms-rtdc-relay:2.0.63"
    networks:
      - itsm
    depends_on:
      - redis
    environment:
      ITSM_ENV: itsm
      ITSM_DOMAIN: ${ITSM_DOMAIN}
      ITSM_CONSUL_URI: http://consul:8500
      ITSM_MS_NODE_ID: "01"
      ITSM_SERVICE_RESOLVER: "docker"
    extra_hosts:
      - "${ITSM_XMPP_HOST}:${ITSM_XMPP_IP}"
      - "${ITSM_WEB_HOST}:${ITSM_WEB_IP}"
    entrypoint: "/bin/bash /on-premise-bootstrap.sh"
    restart: always
  ms_bip:
    image: "comodoitsm/op-ms-bip:2.3.8"
    networks:
      - itsm
    depends_on:
      - consul
      - mongo
      - cdn
      - web
    environment:
      ITSM_ENV: itsm
      ITSM_DOMAIN: ${ITSM_DOMAIN}
      ITSM_CONSUL_URI: http://consul:8500
      ITSM_SERVICE_START_DELAY: 40
      BIP_PUBLIC_SUBDOMAIN: "bip"
      BIP_PUBLIC_SCHEME: "https"
      ITSM_SERVICE_RESOLVER: "docker"
    entrypoint: "/on-premise-bootstrap.sh"
    restart: always
    volumes:
      - "/opt/itsm/bip/customer:/opt/bulk-installation-package/customer"
  ms_cherga:
    image: "comodoitsm/op-ms-cherga:1.7.7"
    networks:
      - itsm
    environment:
      ITSM_ENV: itsm
      ITSM_CONSUL_URI: http://consul:8500
      ITSM_DOMAIN: ${ITSM_DOMAIN}
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
    extra_hosts:
      - "${ITSM_WEB_HOST}:${ITSM_WEB_IP}"
    depends_on:
      - rabbit
      - consul
      - mongo
    command: >
      /bin/bash -c "
        sleep 60;
        /bin/bash /bootstrap.sh
      "
  ms_tasker:
    image: "comodoitsm/op-ms-tasker:1.5.13"
    networks:
      - itsm
    environment:
      ITSM_ENV: itsm
      ITSM_CONSUL_URI: http://consul:8500
      ITSM_DOMAIN: ${ITSM_DOMAIN}
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
    depends_on:
      - consul
    command: >
      /bin/bash -c "
        sleep 60;
        /bin/bash /bootstrap.sh
      "
  stat:
    image: "comodoitsm/op-stat:1.0.2"
    networks:
      - itsm
    depends_on:
      - rabbit
    restart: always
  stat_exporter:
    image: "comodoitsm/op-stats-exporter:0.0.4"
    networks:
      - itsm
    depends_on:
      - stat
      - mongo
    restart: always
    environment:
      - ITSM_DOMAIN
  bin_win_crc:
    image: "comodoitsm/op-bin-win-crc:6.28.26587.19060"
    volumes:
      - "itsm-bin-win-crc:/opt/binaries"
  bin_osx_crc:
    image: "comodoitsm/op-bin-osx-crc:6.28.26609.19060"
    volumes:
      - "itsm-bin-osx-crc:/opt/binaries"
  bin_av_db:
    image: "comodoitsm/op-bin-av-db:1.0.20190620"
    networks:
      - itsm
    restart: always
  cdn:
    image: "comodoitsm/op-bin-cdn:1.1.20190619"
    networks:
      - itsm
    restart: always
    volumes:
      - type: volume
        source: "itsm-bin-win-crc"
        target: /var/cdn/itsm/release/win/remote_control/latest
        volume:
          nocopy: true
      - type: volume
        source: "itsm-bin-osx-crc"
        target: /var/cdn/itsm/release/mac/remote_control/latest
        volume:
          nocopy: true
  be_migrator:
    image: "comodoitsm/op-pm-spm-migrator:0.0.4"
    networks:
      - itsm
    depends_on:
      - postgres
  be_admin:
    image: "comodoitsm/op-pm-spm-admin-portal:0.0.6"
    networks:
      - itsm
    depends_on:
      - postgres
      - be_migrator
    environment:
      ITSM_DOMAIN:
      ITSM_SERVICE_START_DELAY: 25
    restart: always
  be-pm-service:
    image: "comodoitsm/op-be-pm-service:1.6.21"
    networks:
      - itsm
    depends_on:
      - postgres
      - redis
      - rabbit
      - consul
    environment:
      ITSM_SERVICE_START_DELAY: 40
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_RESOLVER: "docker"
      ITSM_DOMAIN: ${ITSM_DOMAIN}
    restart: always
    entrypoint: "/on-premise-bootstrap.sh"
  be-pm-consumer:
    image: "comodoitsm/op-be-pm-consumer:2.3.23"
    networks:
      - itsm
    depends_on:
      - postgres
      - redis
      - rabbit
      - consul
    environment:
      ITSM_SERVICE_START_DELAY: 40
      ITSM_ENV: "itsm"
      ITSM_CONSUL_URI: "http://consul:8500"
      ITSM_SERVICE_RESOLVER: "docker"
    restart: always
networks:
  itsm:

volumes:
  itsm-web-assets:
  itsm-bin-win-crc:
  itsm-bin-osx-crc:

