services:
  opensearch:
    image: nexus.sdi-solution.ru/infra/opensearch:1.3.2
    container_name: opensearch
    hostname: opensearch
    restart: always
    networks:
      - semantic-network
    ports:
      - 9200:9200
    environment:
      - node.name=opensearch-node1
      - cluster.name=opensearch-cluster
      - "OPENSEARCH_JAVA_OPTS=-Xms1G -Xmx1G"
      - http.port=9200
      - discovery.type=single-node
      - bootstrap.memory_lock=true
      - plugins.security.ssl.http.enabled=false
      - indices.query.bool.max_clause_count=100000
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - opensearch-data:/usr/share/opensearch/data
  wildfly:
    image: nexus.sdi-solution.ru/semantic/wildfly:devel
    container_name: wildfly
    restart: always
    networks:
      - semantic-network
    ports:
      - 8080:8080
      - 8443:8443
      - 8990:9990
      - 8787:8787
    environment:
      - VERSION=25.1.0
      - DEBUG=enable
      - MAIN_SERVICE_ROUTE=
      - HOST_NAME=
      # === database === #
      - DATABASE_VENDOR="POSTGRESQL"
      - DATABASE_DRIVER="postgres"
      - DATABASE_CONN=""
      - DATABASE_USER=
      - DATABASE_PASS=
      # === opensearch === #
      - OPENSEARCH_URI=
      - OPENSEARCH_USER=admin
      - OPENSEARCH_PASS=admin
      # === opensearch_uj === #
      - USER_JOURNAL=enable
      - OPENSEARCH_UJ_FLUENT_URI=
      - OPENSEARCH_UJ_FLUENT_TAG=<project_name>_user_journal
      - OPENSEARCH_UJ_URI=
      - OPENSEARCH_UJ_USER=admin
      - OPENSEARCH_UJ_PASS=admin
      - OPENSEARCH_UJ_REPLICAS=0
      # === keycloak === #
      - PROVIDER_URL=
      - UI_CLIENT=
      - CLIENT=
      - CLIENT_SECRET=
      - PUBLIC_CLIENT=
      - KC_ADMIN_URL=
      - KC_ADMIN_REALM=
      # === metrics === #
      - OPENTELEMETRY=
      - OTEL_URI=
      - OTEL_SERVICE_NAME=wildfly_<project_name>
      # === logs === #
      - FLUENT_LOGGER=enable
      - FLUENT_LOGGER_HOST=10.100.0.12
      - FLUENT_LOGGER_PORT=24225
      - FLUENT_LOGGER_TAG=test-wildfly
      # === trusted domains === #
      - SECURITY_DOMAIN=m2.ear,m2-data-quality-plugin.war,konturfocus.war,interoperable-api.war,TechExpert.war
      # === wsdl === #
      - WSDL_HOST=
      - WSDL_PORT=8080
      - WSDL_SECURE_PORT=8443
      - WSDL_URI_SCHEME=http
      # === mail === #
      - MAIL_HOST=
      - MAIL_PORT=
      - MAIL_FROM=""
      - MAIL_USER=""
      - MAIL_PASS=""
      # === cores === #
      - HOST_CORE=
      # === hazelcast === #
      - HZCST_NODE_NAME=
      - HZCST_NODE_PORT=5701
      # === rabbit === #
      - MAIN_HOST=
      - MAIN_USER=
      - MAIN_PASS=
      # === plugins === #
      - DEPLOY_BLOB_CONTENT_STORAGE=enable
      - DEPLOY_CONTENT_STORAGE_INTF=enable
      - DEPLOY_MINIO_CONTENT_STORAGE=disable
      # JasperServer
      - JASPER_URI=
      - JASPER_USER=
      - JASPER_PASS=
      # ML
      - ML_MERGER=
      - ML_SOCKET=
      # === ssl === #
      - KEYSTORE_PASS=null
      - KEY_PASS=null
      - REWRITE_HTTP=null
      # === java options === #
      - JAVA_OPTS=-Xms1G -Xmx1G -XX:MetaspaceSize=1G -XX:MaxMetaspaceSize=1G -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dsun.net.client.defaultReadTimeout=60000 -Dsun.net.client.defaultConnectTimeout=10000 -Djdk.serialFilter='maxbytes=20971520;maxdepth=128;maxarray=700000;maxrefs=700000'
    volumes:
      - /etc/localtime:/etc/localtime:ro
  doc:
    image: nexus.sdi-solution.ru/semantic/doc:dev
    container_name: documentation
    networks:
      - semantic-network
    ports:
      - 80:80
  gateway:
    image: nexus.sdi-solution.ru/semantic/gateway:v1.0
    container_name: gateway
    networks:
      - semantic-network
    ports:
      - 8281:8281
      - 8781:8787
    environment:
      listen_port: 8281
      downstream: http://wildfly:8080
      client_id: 
      client_secret: 
      public_client: 
      token_endpoint: KEYCLOAK_URL/protocol/openid-connect/token
      cache_max_size: 256
      JAVA_OPTS_APPEND:  -agentlib:jdwp=transport=dt_socket,address=gateway:8787,server=y,suspend=n
    command: ['java', '-jar', '/opt/basic.auth.gateway-1.0.0-SNAPSHOT.jar']
  jasperserver:
    image: nexus.sdi-solution.ru/semantic/jasperserver:sdi
    container_name: jasperserver
    hostname: jasperserver
    restart: always
    networks:
      - semantic-network
    ports:
      - 7080:8080
      - 7443:8443
    environment:
      - DB_TYPE=postgres
      - DB_HOST=jasperserver-db
      - DB_PORT=
      - DB_USER=
      - DB_PASSWORD=
      - WF_DOMAIN_NAME=
      - IP_WILDFLY=
      - BUILDOMATIC_MODE=script
    volumes:
      - /etc/localtime:/etc/localtime:ro
  jasperserver-db:
    image: postgres:15
    container_name: jasperserver-db
    hostname: jasperserver-db
    restart: always
    networks:
      - semantic-network
    environment:
      - POSTGRES_PASSWORD=
      - POSTGRES_USER=
      - POSTGRES_DB=jasperserver
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - jasperserver-data:/var/lib/postgresql/data
  rabbitmq:
    image: rabbitmq:3.12.13-management
    container_name: rabbitmq
    hostname: rabbitmq
    restart: always
    networks:
      - semantic-network
    ports:
      - 15672:15672
      - 5672:5672
    environment:
      - RABBITMQ_DEFAULT_USER=m2
      - RABBITMQ_DEFAULT_PASS=m2
      - RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log_levels [{connection,error},{default,error}] disk_free_limit 2147483648
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - rabbitmq-data:/var/lib/rabbitmq
  fluent-bit:
    image: fluent/fluent-bit:4.0
    container_name: fluent-bit-telemetery
    restart: always
    ports:
      - 24223:24223
      - 24224:24224
      - 24225:24225
    networks:
      - semantic-network
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf
  opensearch-uj:
    image: nexus.sdi-solution.ru/infra/opensearch:1.3.2
    container_name: opensearch-uj
    restart: always
    ports:
      - 10200:9200
    environment:
      - node.name=opensearch-node1
      - cluster.name=opensearch-cluster
      - "OPENSEARCH_JAVA_OPTS=-Xms2G -Xmx2G"
      - http.port=9200
      - discovery.type=single-node
      - bootstrap.memory_lock=true
      - plugins.security.ssl.http.enabled=false
      - indices.query.bool.max_clause_count=100000
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - opensearch-uj-data:/usr/share/opensearch/data
    networks:
      - semantic-network
  dashboards:
    image: opensearchproject/opensearch-dashboards:1.3.2
    container_name: dashboards
    ports:
      - 5601:5601
    volumes:
      - ./config/opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml
    depends_on:
      - opensearch-uj
    networks:
      - semantic-network
  otel-collector:
    image: nexus.sdi-solution.ru/infra/opentelemetry:0.123.0
    container_name: otel-collector
    command: [--config=/etc/otel-collector-config.yml]
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config/otel-collector-config.yml:/etc/otel-collector-config.yml
    ports:
      - 4317:4317 # OTLP gRPC receiver
      - 4318:4318 # OTLP http receiver
      - 1234:1234 # /metrics endpoint
    networks:
      - semantic-network
  data-prepper:
    image: opensearchproject/data-prepper:2
    container_name: data-prepper
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config/pipelines.yaml:/usr/share/data-prepper/pipelines/pipelines.yaml
      # - ./log_pipeline.yaml:/usr/share/data-prepper/pipelines/log_pipeline.yaml
      - ./config/data-prepper-config.yaml:/usr/share/data-prepper/config/data-prepper-config.yaml
    ports:
      - 2021:2021
      - 2022:2022
      - 21890:21890
    networks:
      - semantic-network
#  minio:
#    image: minio/minio:RELEASE.2025-02-07T23-21-09Z
#    hostname: minio
#    restart: always
#    networks:
#      - semantic-network
#    ports:
#      - 9000:9000
#      - 9001:9001
#    environment:
#      MINIO_ROOT_USER: 
#      MINIO_ROOT_PASSWORD:
#    command: server --console-address ":9001" /data
#    volumes:
#     - minio-data:/data
volumes:
  opensearch-data:
    name: opensearch-data
  jasperserver-data:
    name: jasperserver-data
  rabbitmq-data:
    name: rabbitmq-data
  opensearch-uj-data:
    name: opensearch-uj-data
#  minio-data:
#   name: minio-data
networks:
  semantic-network:
    driver: bridge