version: "3.7"
services:
  uvhub:
    image: envirover/uvhub:2.2.0
    restart: always
    depends_on:
      - elasticsearch
    ulimits:
      nofile:
        soft: 65536
        hard: 65536         
    ports: 
      - "5080:5080" # HTTP port used by RockBLOCK services to POST mobile-originated messages
      - "5060:5060" # TCP port used by connections from SPL RadioRoom
      - "5760:5760" # TCP port used for MAVLink ground control stations connections
      - "5757:5757" # TCP port used to update reported parameters and missions in the shadow
    environment: 
      - "ROCKBLOCK_IMEI=${ROCKBLOCK_IMEI}"
      - "ROCKBLOCK_USERNAME=${ROCKBLOCK_USERNAME}"
      - "ROCKBLOCK_PASSWORD=${ROCKBLOCK_PASSWORD}"
      - "MAV_AUTOPILOT=3"
      - "MAV_TYPE=2"
      - "MAV_SYSID=1"
      - "ELASTICSEARCH_ENDPOINT=elasticsearch"
  uvtracks:
    image: envirover/uvtracks:2.2.0
    restart: always
    hostname: uvtracks
    depends_on:
      - elasticsearch
    ulimits:
      nofile:
        soft: 65536
        hard: 65536         
    ports: 
      - "8080:8080"
    environment: 
      - "MAV_SYSID=1"
      - "ELASTICSEARCH_ENDPOINT=elasticsearch"      
  uvcockpit:
    image: envirover/uvcockpit:2.2.0
    restart: always
    depends_on: 
      - uvtracks
    ulimits:
      nofile:
        soft: 65536
        hard: 65536         
    ports: 
      - "80:80"
    environment: 
      - "UVTRACKS_PRIVATE_URL=http://uvtracks:8080"
  elasticsearch:
    image: elasticsearch:6.7.1
    restart: always
    hostname: elasticsearch
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    ports:
      - "9200:9200"
      - "9300:9300"
    environment: 
      - "discovery.type=single-node"
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"