services:
  elk:
    image: "comodoitsm/op-elk:1.4.0"
    networks:
      - itsm
    ports:
      - 5601:5601
      - 1514:1514
    volumes:
      - "/opt/itsm/elk/elasticsearch:/var/lib/elasticsearch"
    restart: always
  web:
    image: "comodoitsm/op-web:6.28.25526.19060.12-1"
    ports:
      - 443:443
      - 80:80
    networks:
      - itsm
    extra_hosts:
      - "${ITSM_XMPP_HOST}:${ITSM_XMPP_IP}"
    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_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
    restart: always
  redis:
    image: "redis:5.0.2"
    restart: always
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
    networks:
      - itsm
    ports:
      - '6379:6379'
    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
    ports:
      - 5432:5432
  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
    ports:
      - 5672:5672
      - 15672:15672
    networks:
      - itsm
    hostname: itsm-rabbit
    restart: always
  consul:
    image: "comodoitsm/op-consul:1.1.21"
    hostname: consul
    ports:
      - 8500:8500
      - 8300:8300
      - 8301:8301
      - 8302:8302
      - 8600:8600
    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
    ports:
      - 27017:27017
    volumes:
      - "/opt/itsm/mongo/data:/data/db"
    restart: always
  ms_dc:
    image: "comodoitsm/op-ms-dc:1.3.3"
    networks:
      - itsm
    depends_on:
      - rabbit
      - consul
    ports:
      - 8891:8891
    environment:
      ITSM_SERVICE_START_DELAY: 40
    restart: always
  ms_customer:
    image: "comodoitsm/op-ms-customer:2.1.9"
    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.5"
    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.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_fr:
    image: "comodoitsm/op-ms-fr:1.3.8"
    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.29"
    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
    ports:
      - 8334:8334
      - 8335:8335
      - 8336:8336
    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.10"
    ports:
      - 8895:8895
    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
    ports:
      - 8993:80
    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"
    ports:
      - 7878:7878
    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:0.2.4"
    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:1.0.1"
    networks:
      - itsm
    ports:
      - 8080:8080
    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:0.1.5"
    networks:
      - itsm
    ports:
      - 8081:8081
    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.13-op"
    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.12.102"
    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
    ports:
      - 7950:7950
    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.58"
    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"
    ports:
      - 7951:7951
    extra_hosts:
      - "${ITSM_XMPP_HOST}:${ITSM_XMPP_IP}"
      - "${ITSM_WEB_HOST}:${ITSM_WEB_IP}"
    entrypoint: "/bin/bash /on-premise-bootstrap.sh"
    restart: always
  itsm_turn:
    image: "comodoitsm/op-turn:1.0.0"
    network_mode: "host"
    environment:
      - EXTERNAL_IP
      - STATIC_AUTH_SECRET=itsm-turn-secret
      - REALM=cmdm
    volumes:
      - "/opt/itsm/turn:/var/lib/turn/turndb"
    restart: always
  ms_bip:
    image: "comodoitsm/op-ms-bip:2.2.11"
    networks:
      - itsm
    depends_on:
      - consul
      - mongo
      - cdn
    ports:
      - 5151:5151
      - 5152:5152
    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
  ms_cherga:
    image: "comodoitsm/op-ms-cherga:1.6.3"
    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
    ports:
      - 81:80
    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.27.25620.19040"
    volumes:
      - "itsm-bin-win-crc:/opt/binaries"
  bin_osx_crc:
    image: "comodoitsm/op-bin-osx-crc:6.27.25036.19040"
    volumes:
      - "itsm-bin-osx-crc:/opt/binaries"
  bin_av_db:
    image: "comodoitsm/op-bin-av-db:1.0.20190422"
    networks:
      - itsm
    ports:
      - 12546:80
    restart: always
  cdn:
    image: "comodoitsm/op-bin-cdn:1.1.20190506"
    networks:
      - itsm
    ports:
      - 8123:80
    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
networks:
  itsm:

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

