version: '3.4'

#ESPP TEMPLATE SYNC
services:
  parr-espp-template-sync:
    image: harbor.dvgd.rzd/parr/parr-espp-template-sync:${tag:-latest}
    #container_name: parr-espp-template-sync
    #restart: always
    environment:
      - ASPNETCORE_ENVIRONMENT=Production
      - TZ=Europe/Moscow
      - GlobalSettings__MqSettings__HostName=parr-rabbitmq
    #volumes:
      #- /var/log/parr-espp-template-sync:/app/log
      #- parr_storage_dev:/app/Data
    logging:
      driver: fluentd
      options:
        fluentd-address: dvgd-efk-01.dvgd.oao.rzd:24224
        fluentd-retry-wait: '10s'
        fluentd-max-retries: '30'
        fluentd-async: 'true'
        fluentd-buffer-limit: '52428800'
        tag: parr.espp-template-sync.serilog
    deploy:
      replicas: 4
    networks:
      - parr-network

  parr-rabbitmq:
    #image: rabbitmq:3.12.4-management
    image: rabbitmq:4.2.0-management
    #container_name: rabbitmq
    hostname: parr-rabbitmq
    environment:
      - RABBITMQ_DEFAULT_USER=rmuser
      - RABBITMQ_DEFAULT_PASS=PoadhH&5%!gjdfhg<Jhhg
      #- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log_levels [{connection,error},{default,error}] disk_free_limit 2147483648
      - RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log_levels [{connection,error},{default,error}] -disk_free_limit 2147483648
    volumes:
      - parr_rabbit:/var/lib/rabbitmq
    ports:
      - 15672:15672
      - 5672:5672
    deploy:
      replicas: 1
    networks:
      - parr-network

volumes:
  #parr_storage_dev:
    #name: parr_storage_dev
    #driver: local
    #driver_opts:
      #type: cifs
      #o: "addr=dvgd-appfs-01,username=parruserdev,password=P@ssDevParr202MM"
      #device: //dvgd-appfs-01/parr_storage_dev
  parr_rabbit:
    name: parr_rabbit
    driver_opts:
      type: "nfs"
      o: "addr=dvgd-appfs-01.dvgd.oao.rzd,soft,rw,nfsvers=4"
      device: ":/nfs/dvgd-swarm-01/parr_rabbit/data"


networks:
  parr-network:
    driver: overlay
    external: true

# последняя версия
#docker compose -f docker-compose.espp-template-sync.yml up -d
# указанная версия
#tag=v1.0.0 docker compose -f docker-compose.espp-template-sync.yml up -d