version: '3.5'

services:
  inbiz:
    hostname: inbiz
    image: registry.edoc2.com:5000/edoc2v5/inbiz:inbiz-v6.5.1.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      # - LogFormatType=KB
      # - DatabaseInitializerSqlLog=true
    env_file:
      ./envfile.env
    # depends_on:
    #   - redis
    #   - rabbitmq
    #   - edoc2
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    healthcheck:
      test: /bin/bash /opt/inbiz_check.sh
      interval: 15s
      timeout: 10s
      retries: 3
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
#    logging:
#      driver: syslog
#      options:
#        syslog-address: "udp://logserver:55514"
#        syslog-format: "rfc3164"
#        tag: "edoc2"

  static-resource:
    hostname: static-resource
    image: registry.edoc2.com:5000/edoc2v5/static-resource:inbiz-v6.5.1.0
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      #- GrpcMaxReceiveMessageSize=10
      #- InBizAllowFileUploadTypes=.css|.js|.json|.bmp|.png|.jpg|.jpeg|.gif|.svg
    env_file:
      ./envfile.env
    labels:
      "type": "1"
    # depends_on:
    #   - redis
    #   - rabbitmq
    networks: 
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  inbiz-initdatabase:
    hostname: inbiz-initdatabase
    image: registry.edoc2.com:5000/edoc2v5/inbiz-initdatabase:inbiz-v6.5.1.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      - INBIZINITDATABASE=true
      # - DatabaseInitializerSqlLog=true
    env_file:
      ./envfile.env
    # depends_on:
    #   - redis
    #   - rabbitmq
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    deploy:
      replicas: 1
      endpoint_mode: dnsrr
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
#    logging:
#      driver: syslog
#      options:
#        syslog-address: "udp://logserver:55514"
#        syslog-format: "rfc3164"
#        tag: "edoc2"

  inbiz-backend:
    hostname: inbiz-backend
    image: registry.edoc2.com:5000/edoc2v5/inbiz-backend:inbiz-v6.5.1.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      - InBiz_RunTimeType=1
      # - LogFormatType=KB
      # - InBizHttpServicePort=5006
      # - InBizGrpcServicePort=15006
      # - INBIZSKIPWAITINITDATABASE=false
      # - InBizAllowFileUploadTypes=.css|.js|.json|.bmp|.png|.jpg|.jpeg|.gif|.svg
    env_file:
      ./envfile.env
    # depends_on:
    #   - inbiz-initdatabase
    # #   - rabbitmq
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    healthcheck:
      test: /bin/bash /opt/inbiz_check.sh
      interval: 15s
      timeout: 10s
      retries: 3
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
#    logging:
#      driver: syslog
#      options:
#        syslog-address: "udp://logserver:55514"
#        syslog-format: "rfc3164"
#        tag: "edoc2"

  inbiz-backend-api:
    hostname: inbiz-backend-api
    image: registry.edoc2.com:5000/edoc2v5/inbiz-backend:inbiz-v6.5.1.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      - InBiz_RunTimeType=0
      # - LogFormatType=KB
      # - InBizHttpServicePort=5006
      # - InBizGrpcServicePort=15006
      # - INBIZSKIPWAITINITDATABASE=false
      # - InBizAllowFileUploadTypes=.css|.js|.json|.bmp|.png|.jpg|.jpeg|.gif|.svg
    env_file:
      ./envfile.env
    # depends_on:
    #   - inbiz-initdatabase
    # #   - rabbitmq
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    healthcheck:
      test: /bin/bash /opt/inbiz_check.sh
      interval: 15s
      timeout: 10s
      retries: 3
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
#    logging:
#      driver: syslog
#      options:
#        syslog-address: "udp://logserver:55514"
#        syslog-format: "rfc3164"
#        tag: "edoc2"
  
  inbiz-model:
    hostname: inbiz-model
    image: registry.edoc2.com:5000/edoc2v5/inbiz-model:inbiz-v6.5.1.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      # - LogFormatType=KB
      # - InBizHttpServicePort=5006
      # - InBizGrpcServicePort=15006
      # - INBIZSKIPWAITINITDATABASE=false
      # - InBizAllowFileUploadTypes=.css|.js|.json|.bmp|.png|.jpg|.jpeg|.gif|.svg
    env_file:
      ./envfile.env
    # depends_on:
    #   - inbiz-initdatabase
    # #   - rabbitmq
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
#    logging:
#      driver: syslog
#      options:
#        syslog-address: "udp://logserver:55514"
#        syslog-format: "rfc3164"
#        tag: "edoc2"
   
  inbiz-business:
    hostname: inbiz-business
    image: registry.edoc2.com:5000/edoc2v5/inbiz-business:inbiz-v6.5.1.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  inbiz-businesslog:
    hostname: inbiz-businesslog
    image: registry.edoc2.com:5000/edoc2v5/inbiz-businesslog:inbiz-v6.5.1.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  inbiz-frontend:
    hostname: inbiz-frontend
    image: registry.edoc2.com:5000/edoc2v5/inbiz-frontend:inbiz-v6.5.1.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      # - LogFormatType=KB
      # - InBizHttpServicePort=5006
      # - InBizGrpcServicePort=15006
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    # healthcheck:
    #   test: /bin/bash /opt/inbiz_check.sh
    #   interval: 15s
    #   timeout: 10s
    #   retries: 3
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
#    logging:
#      driver: syslog
#      options:
#        syslog-address: "udp://logserver:55514"
#        syslog-format: "rfc3164"
#        tag: "edoc2"

  inbiz-miniprogram:
    hostname: inbiz-miniprogram
    image: registry.edoc2.com:5000/edoc2v5/inbiz-miniprogram:inbiz-v6.5.1.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    # healthcheck:
    #   test: /bin/bash /opt/inbiz_check.sh
    #   interval: 15s
    #   timeout: 10s
    #   retries: 3
    deploy:
      replicas: 1
      endpoint_mode: dnsrr
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
#    logging:
#      driver: syslog
#      options:
#        syslog-address: "udp://logserver:55514"
#        syslog-format: "rfc3164"
#        tag: "edoc2"

  wf:
    image: registry.edoc2.com:5000/edoc2v5/wf:inbiz-v6.5.1.0
    labels:
      "type": "2"
    networks:
      - edoc2
    environment:
      - swaggerEnable=false
      - proExtension=true
#      - externalUrl=http://nginx
    env_file:
      ./envfile.env
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          cpus: '8'
#    healthcheck:
#      test: curl -L -k -i http://edoc2/api/values|grep "200 OK"
#      interval: 10s
#      timeout: 3s
#      retries: 3
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
networks:
  edoc2:
    external: true
    name: macrowing