# Copyright (c) Mainflux
# SPDX-License-Identifier: Apache-2.0

# This docker-compose file contains optional lora-adapter and lora-redis services
# for the Mainflux platform. Since this services are optional, this file is dependent on the
# docker-compose.yml file from <project_root>/docker/. In order to run these services,
# core services, as well as the network from the core composition, should be already running.

version: "3.7"

networks:
  docker_mainflux-base-net:
    external: true

services:
  lora-redis:
    image: redis:5.0-alpine
    container_name: mainflux-lora-redis
    restart: on-failure
    networks:
      - docker_mainflux-base-net

  lora-adapter:
    image: mainflux/lora:latest
    container_name: mainflux-lora
    restart: on-failure
    environment:
      MF_LORA_ADAPTER_LOG_LEVEL: ${MF_LORA_ADAPTER_LOG_LEVEL}
      MF_THINGS_ES_URL: es-redis:${MF_REDIS_TCP_PORT}
      MF_LORA_ADAPTER_ROUTE_MAP_URL: lora-redis:${MF_REDIS_TCP_PORT}
      MF_LORA_ADAPTER_MESSAGES_URL: ${MF_LORA_ADAPTER_MESSAGES_URL}
      MF_LORA_ADAPTER_HTTP_PORT: ${MF_LORA_ADAPTER_HTTP_PORT}
      MF_NATS_URL: ${MF_NATS_URL}
    ports:
      - ${MF_LORA_ADAPTER_HTTP_PORT}:${MF_LORA_ADAPTER_HTTP_PORT}
    networks:
      - docker_mainflux-base-net
