version: '2.4'

services:

  pushka:
    image: registry.gitlab.com/samarasoft/pushka/prod
    environment:
      ASPNETCORE_URLS: "http://*:8030"
      UNIONE_API_KEY: "6h58ary5hakae54aixp6fdfg36sxeditxxobt1wy"
      DB_HOST: postgres_pushka
      DB_PORT: 5432
      DB_NAME: pushka
      DB_USER: admin
      DB_PASSWORD: password
      RMQ_HOST: rabbitmq_pushka
      RMQ_USER: admin
      RMQ_PASSWORD: password
      RMQ_QUEUE: Pushka
      ADMIN_PASSWORD : brRJ0xQk%C 
      RMQ_VIRTUAL_HOST: "/"
      JWT_SIGNING_KEY: "hdcbviueoirtuoenvdbfvusjorgtuhdhgisfjnmg"
      JWT_EXPIRES_SEC: 86400
      JWT_AUDIENCE: "pushka"
      JWT_ISSUER: "pushka"
      TEMPLATE_DB_HOST: postgres_pushka
      TEMPLATE_DB_PORT: 5432
      TEMPLATE_DB_NAME: email_template
      TEMPLATE_DB_USER: admin
      TEMPLATE_DB_PASSWORD: password
      Processing__JWT_SIGNING_KEY: "ohjfdphoakdgoithjitobkmapfkrhjthoisdjfgf"
      Processing__JWT_EXPIRES_SEC: 315360000
      Processing__JWT_AUDIENCE: "processing"
      Processing__JWT_ISSUER: "pushka"
      tracking__JWT_SIGNING_KEY: "mhjfdphoakdgoithjitobkmapfkrhjthoisdjfgq"
      tracking__JWT_EXPIRES_SEC: 315360000
      tracking__JWT_AUDIENCE: "tracking"
      tracking__JWT_ISSUER: "pushka"
      SITE_URL:  "http://Ввести IP машины"
      STANDARD_PASSWORD: "password*1"
      BITRIX_WEB_HOOK_URL: "https://app.salebridge.ru/bitrix24/webhook/"
      GOOGLE_API_ISSUER_ID: "3388000000021805922"
      CRM_URL: 
    restart: on-failure
    ports:
      - "8030:8030"
    labels:
      NAME: "pushka"
    depends_on:
      postgres_pushka:
        condition: service_started
      rabbitmq_pushka:
        condition: service_healthy
    networks:
      - pushka
      
  adminpanel:
    image: registry.gitlab.com/samarasoft/pushkagroup/pushka.adminpanel/dev
    environment:
      ASPNETCORE_URLS: "http://*:8031"
      DB_HOST: postgres_pushka
      DB_PORT: 5432
      DB_NAME: adminpanel
      DB_USER: admin
      DB_PASSWORD: password    
      JWT_SIGNING_KEY: "hdcbviueoirtuoenvdbfvusjorgtuhdhgisfjnmg"
      JWT_EXPIRES_SEC: 86400
      JWT_AUDIENCE: "pushka"
      JWT_ISSUER: "pushka"
      Users__DB_HOST: postgres_pushka
      Users__DB_PORT: 5432
      Users__DB_NAME: pushka
      Users__DB_USER: admin
      Users__DB_PASSWORD: password
      SALEBRIDGE_URL : "http://Ввести IP:8030/"   
    restart: on-failure
    ports:
      - "8031:8031"
    labels:
      NAME: "adminpanel"
    depends_on:
      pushka:
        condition: service_started
    networks:
      - pushka
    
  processing:
    image: registry.gitlab.com/samarasoft/pushkagroup/samarasoft.loyalty/dev
    environment:
      ASPNETCORE_URLS: "http://*:5000"
      DB_HOST: postgres_pushka
      DB_PORT: 5432
      DB_NAME: "loyalty_workspaces"
      DB_PREFIX_NAME: "loyalty"
      DB_USER: admin
      DB_PASSWORD: password
      RMQ_HOST: rabbitmq_pushka
      RMQ_VIRTUAL_HOST: "/"
      RMQ_USER: admin
      RMQ_PASSWORD: password
      RMQ_QUEUE: PushkaProcessing
      JWT_SIGNING_KEY: "ohjfdphoakdgoithjitobkmapfkrhjthoisdjfgf"
      JWT_EXPIRES_SEC: 315360000
      JWT_AUDIENCE: "processing"
      JWT_ISSUER: "pushka"
      AAUTH_KEY: secret
    restart: on-failure
    ports:
      - "5000:5000"
    labels:
      NAME: "processing"
    depends_on:
      postgres_pushka:
        condition: service_started
      rabbitmq_pushka:
        condition: service_healthy
    networks:
      - pushka
      
  frontol:
    image: registry.gitlab.com/samarasoft/pushka.frontol/dev
    environment:
      ASPNETCORE_URLS: "http://*:5088"
      DB_HOST: postgres_pushka
      DB_PORT: 5432
      DB_NAME: "pushka_frontol"
      DB_USER: admin
      DB_PASSWORD: password
      RMQ_HOST: rabbitmq_pushka
      RMQ_VIRTUAL_HOST: "/"
      RMQ_USER: admin
      RMQ_PASSWORD: password
      RMQ_QUEUE: PushkaFrontol      
      PROCESSING_URL: processing
      PROCESSING_AUTH_KEY: "secret"
    restart: on-failure
    ports:
      - "5088:5088"
    labels:
      NAME: "frontol"
    depends_on:
      rabbitmq_pushka:
        condition: service_healthy
    networks:
      - pushka

  tracking:
    image: registry.gitlab.com/samarasoft/pushka.tracking/dev
    environment:
     ASPNETCORE_URLS: "http://*:5050"
     RMQ_HOST: rabbitmq_pushka
     RMQ_USER: admin
     RMQ_PASSWORD: password
     RMQ_QUEUE: PushkaTracking
     RMQ_VIRTUAL_HOST: "/"
     JWT_SIGNING_KEY: "mhjfdphoakdgoithjitobkmapfkrhjthoisdjfgq"
     JWT_EXPIRES_SEC: 315360000
     JWT_AUDIENCE: "tracking"
     JWT_ISSUER: "pushka"
    restart: on-failure
    ports:
      - "5050:5050"
    labels:
      NAME: "tracking"
    depends_on:
      rabbitmq_pushka:
        condition: service_healthy
    networks:
      - pushka

  rabbitmq_pushka:
    image: rabbitmq:3.8-management
    hostname: rabbitmq
    environment:
      RABBITMQ_DEFAULT_USER: "admin"
      RABBITMQ_DEFAULT_PASS: "password"
      RABBITMQ_DEFAULT_VHOST: "/"
    ports:
      - "15673:15672"
      - "5673:5672"
    labels:
      NAME: "rabbitmq"
    healthcheck:
      timeout: 5s
      interval: 5s
      retries: 5
      test:
        - "CMD"
        - "rabbitmqctl"
        - "status"
    networks:
      - pushka
      
  postgres_pushka:
    image: postgres:13
    environment:
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: password
      POSTGRES_DB: pushka
    volumes:
       - pushkadata:/var/lib/postgresql/data
    ports:
      - "5433:5432"
    labels:
      NAME: "postgres"
    networks:
      - pushka

  email_sender:
    image: registry.gitlab.com/samarasoft/pushka.emailsender/dev
    environment:
      ASPNETCORE_URLS: "http://*:5001"
      DB_HOST: postgres_pushka
      DB_PORT: 5432
      DB_NAME: "email_sender"
      DB_USER: admin
      DB_PASSWORD: password
      RMQ_HOST: rabbitmq_pushka
      RMQ_USER: admin
      RMQ_PASSWORD: password
      RMQ_QUEUE: "PushkaEmailSender"
      RMQ_VIRTUAL_HOST: "/"  
      UNIONE_WEBHOOK_URL: "http://salebridge-qa1.samaralab.ru:5001/update"
    restart: on-failure
    ports:
      - "5001:5001"
    labels:
      NAME: "processing"
    depends_on:
      postgres_pushka:
        condition: service_started
      rabbitmq_pushka:
        condition: service_healthy
    networks:
      - pushka

  push_sender:
    image: registry.gitlab.com/samarasoft/pushka.pushsender/dev
    environment:
      ASPNETCORE_URLS: "http://*:5010"
      DB_HOST: postgres_pushka
      DB_PORT: 5432
      DB_NAME: "push_sender"
      DB_USER: admin
      DB_PASSWORD: password
      RMQ_HOST: rabbitmq_pushka
      RMQ_USER: admin
      RMQ_PASSWORD: password
      RMQ_QUEUE: "PushkaPushSender"
      RMQ_VIRTUAL_HOST: "/"
    restart: on-failure
    ports:
      - "5010:5010"
    labels:
      NAME: "processing"
    depends_on:
      postgres_pushka:
        condition: service_started
      rabbitmq_pushka:
        condition: service_healthy
    networks:
      - pushka

  sms_sender:
    image: registry.gitlab.com/samarasoft/pushka.smssender/dev
    environment:
      ASPNETCORE_URLS: "http://*:5020"
      DB_HOST: postgres_pushka
      DB_PORT: 5432
      DB_NAME: "sms_sender"
      DB_USER: admin
      DB_PASSWORD: password
      RMQ_HOST: rabbitmq_pushka
      RMQ_USER: admin
      RMQ_PASSWORD: password
      RMQ_QUEUE: "PushkaSmsSender"
      RMQ_VIRTUAL_HOST: "/"  
      SMSGOROD_WEBHOOK_URL: "https://smsgorod.samarasoft.com/smsstatus"
    restart: on-failure
    ports:
      - "5020:5020"
    labels:
      NAME: "processing"
    depends_on:
      postgres_pushka:
        condition: service_started
      rabbitmq_pushka:
        condition: service_healthy
    networks:
      - pushka
      
volumes:
  pushkadata:

networks:
  pushka:
