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

# This docker-compose file contains optional cassandra-reader. Since it's optional, this file is
# dependent of docker-compose file from <project_root>/docker. In order to run this service, execute command:
# docker-compose -f docker/docker-compose.yml -f docker/addons/cassandra-reader/docker-compose.yml up
# from project root.

version: "3.7"

networks:
  docker_mainflux-base-net:
    external: true

services:
  cassandra-reader:
    image: mainflux/cassandra-reader:latest
    container_name: mainflux-cassandra-reader
    restart: on-failure
    environment:
      MF_CASSANDRA_READER_LOG_LEVEL: ${MF_CASSANDRA_READER_LOG_LEVEL}
      MF_CASSANDRA_READER_PORT: ${MF_CASSANDRA_READER_PORT}
      MF_CASSANDRA_READER_DB_CLUSTER: ${MF_CASSANDRA_READER_DB_CLUSTER}
      MF_CASSANDRA_READER_DB_KEYSPACE: ${MF_CASSANDRA_READER_DB_KEYSPACE}
      MF_CASSANDRA_READER_SERVER_CERT: ${MF_CASSANDRA_READER_SERVER_CERT}
      MF_CASSANDRA_READER_SERVER_KEY: ${MF_CASSANDRA_READER_SERVER_KEY}
      MF_JAEGER_URL: ${MF_JAEGER_URL}
      MF_THINGS_AUTH_GRPC_URL: ${MF_THINGS_AUTH_GRPC_URL}
      MF_THINGS_AUTH_GRPC_TIMEOUT: ${MF_THINGS_AUTH_GRPC_TIMEOUT}
    ports:
      - ${MF_CASSANDRA_READER_PORT}:${MF_CASSANDRA_READER_PORT}
    networks:
      - docker_mainflux-base-net
    volumes:
      - ../../ssl/certs:/etc/ssl/certs
