
version: "3.7"

networks:
  mother:
    external: true



  
services:
  ls:
    image: registry.vnfco.ir/ig/localserver:latest
    environment:
      - ASPNETCORE_ENVIRONMENT=Production
      - TZ=Asia/Tehran
    deploy:
      update_config:
        parallelism: 1
        delay: 10s
        order: start-first
      restart_policy:
        condition: any
        delay: 5s
        window: 120s 
      resources:
        reservations:
          cpus: "1"
          memory: "1G"
        limits:
          memory: 1Gi
      replicas: 1
      mode: replicated
      placement:
        constraints:
          - node.role == worker
    volumes:
      - type: bind
        source: /volume/ig/ls/wwwroot
        target: /app/wwwroot
      - type: bind
        source: /volume/config/ls/appsettings.Production.json
        target: /app/appsettings.Production.json
      - type: bind
        source: /etc/localtime
        target: /etc/localtime
        read_only: true
      - type: bind
        source: /etc/timezone
        target: /etc/timezone
        read_only: true
    ports:
      - 8010:8010
    networks:
      - mother

  core:
    image: registry.vnfco.ir/ig/api:latest
    environment:
      - SPRING_PROFILES_ACTIVE=prod
      - TZ=Asia/Tehran
    deploy:
      update_config:
        parallelism: 1
        delay: 10s
        order: start-first
      restart_policy:
        condition: any
        delay: 5s
        window: 120s 
      resources:
        limits:
          cpus: '1'
          memory: 600m
      replicas: 1
      mode: replicated
      placement:
        constraints:
          - node.role == worker
    volumes:
      - type: bind
        source: /volume/ig
        target: /target/storage
      - type: bind
        source: /data/backup
        target: /target/backup
      - type: bind
        source: /volume/config/core/application-prod.properties
        target: /target/classes/application-prod.properties
      - type: bind
        source: /volume/ig/api/logs/http.log
        target: /target/logs/http.log
      - type: bind
        source: /volume/ig/api/logs/error.log
        target: /target/logs/error.log
      - type: bind
        source: /volume/ig/api/logs/archive
        target: /target/logs/archive
      - type: bind
        source: /etc/localtime
        target: /etc/localtime
        read_only: true
      - type: bind
        source: /etc/timezone
        target: /etc/timezone
        read_only: true
    ports:
      - 8011:8080
    networks:
      - mother

    

  sms:
    image: registry.vnfco.ir/ig/sms:latest
    environment:
      - QUEUE_NAME=ig-sms
      - RABBIT_URI=amqp://igarsonAgent:muyXHzymcTYLzk3wYnIwG+UJWECKy0ViUDO+UlCmPF3XS+2kliuV0TaA0mWf6lT@rabbitmq:5672
      - SMS_SERVICE_URI=https://api.kavenegar.com/v1/
      - USERAPIKEY=3735494B4143727A794346457461576A2B4B6668414973424E333561505A694B
      - SECRETKEY=!#u*(!@ofOAJDU31y+
      - LINENUMBER=2000500666
      - VERIFICATION_SERVICE_CONTEXT_PATH=/verify/lookup.json
      - SMS_SERVICE_CONTEXT_PATH=/sms/lookup.json

      - TZ=Asia/Tehran
    deploy:
      update_config:
        parallelism: 1
        delay: 10s
        order: start-first
      restart_policy:
        condition: any
        delay: 5s
        window: 120s 
      resources:
        limits:
          cpus: '0.5'
          memory: 10m
      replicas: 1
      mode: replicated
      placement:
        constraints:
          - node.role == worker
    networks:
      - mother
      
  yaus:
    image: registry.vnfco.ir/ig/yaus:latest
    environment:
      - MONGO_URL=mongodb://API:dljHVOHjf6123HDHWADOU8123@mongoprimary:27017,mongosecondary:27017/yaus?authSource=yaus
      - URL_NOTFOUND=https://igarson.app/404
      - TOLL=https://igarson.app/goto?dest=
      - COLLECTION_MONGO=urls
      - DATABASE_MONGO=yaus
      - DOMAIN=igli.ir
      - TZ=Asia/Tehran
    deploy:
      update_config:
        parallelism: 1
        delay: 10s
        order: start-first
      restart_policy:
        condition: any
        delay: 5s
        window: 120s 
      resources:
        limits:
          cpus: '0.5'
          memory: 10m
      replicas: 1
      mode: replicated
      placement:
        constraints:
          - node.role == worker
    ports:
      - "8016:8000"
    networks:
      - mother

      




