services:
  db:
    container_name: mssql-container
    image: mcr.microsoft.com/mssql/server:latest
    restart: always
    environment:
      ACCEPT_EULA: "Y"
      MSSQL_SA_PASSWORD: "Example123" #This is just an example - CHANGE THIS!!!
    ports: 
    - "1433:1433"

  log-db:
    container_name: elastic-search
    image: docker.elastic.co/elasticsearch/elasticsearch:8.15.3
    restart: always
    environment:
      discovery.type: "single-node"
      xpack.security.enabled: $ENABLE_SECURITY # To allow http connection during development - remove after!
      elastic_password: $ELASTIC_PASSWORD
    ports:
      - "9200:9200"
      - "9300:9300"

  kibana:
    container_name: kibana
    image: docker.elastic.co/kibana/kibana:8.15.3
    ports:
      - 5601:5601
    depends_on:
      - log-db
    environment:
      ELASTICSEARCH_HOSTS: http://elastic-search:9200
      XPACK_SECURITY_ENABLED: $ENABLE_SECURITY
      ELASTICSEARCH_USER: $ELASTIC_USER
      ELASTICSEARCH_PASSWORD: $ELASTIC_PASSWORD
  
  api:
    container_name: biterate-api
    environment:
      - ASPNETCORE_URLS=http://+:5171
    build: 
      dockerfile: Dockerfile_API
    ports:
      - "5171:5171"
    volumes:
      - ./img:/img
    depends_on: 
      - db
      - log-db
    profiles:
      - full
  
  mvc:
    container_name: biterate-mvc
    environment:
      - ASPNETCORE_URLS=http://+:5173
    build:
      dockerfile: Dockerfile_MVC
    ports:
      - "5173:5173"
    volumes:
      - ./img:/img
    depends_on: 
      - db
      - log-db
    profiles:
      - full