
version: "3.7"

networks:
  mother:
    external: true



  
services:
  ls:
    image: registry.vnfco.ir/ig/localserver:latest
    environment:
      - ASPNETCORE_ENVIRONMENT=Production
    deploy:
      update_config:
        parallelism: 1
        delay: 10s
        order: start-first
      restart_policy:
        condition: any
        delay: 5s
        window: 120s 
      resources:
        limits:
          cpus: '1'
          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
    ports:
      - 8010:8010
    networks:
      - mother

  core:
    image: registry.vnfco.ir/ig/api:latest
    environment:
      - SPRING_PROFILES_ACTIVE=prod
    deploy:
      update_config:
        parallelism: 1
        delay: 10s
        order: start-first
      restart_policy:
        condition: any
        delay: 5s
        window: 120s 
      resources:
        limits:
          cpus: '1'
          memory: 500m
      replicas: 1
      mode: replicated
      placement:
        constraints:
          - node.role == worker
    volumes:
      - type: bind
        source: /volume/ig/api/storage
        target: /target/storage
      - type: bind
        source: /volume/config/core/application-prod.properties
        target: /target/classes/application-prod.properties
    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/
      - SMS_SERVICE_CONTEXT_PATH=/sms/send.json
      - USERAPIKEY=7461633837643439575446434F7161634F676C58426E674B396A5356586A3173
      - SECRETKEY=!#u*(!@ofOAJDU31y+
    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/notfound
      - TOLL=https://igarson.app/goto?dest=
      - COLLECTION_MONGO="urls"
      - DATABASE_MONGO=yaus
      - DOMAIN=qr.igarson.app
    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

      




