version: '3.5'

services:
  inbiz:
    hostname: inbiz
#    image: registry.edoc2.com:5000/edoc2v5/inbiz:inbiz-v6.0.0.0-beta1
#    image: 192.168.251.78/edoc2v5/inbiz:20220825111421_ca69296bf6cf7360
#    image: 192.168.251.78/edoc2v5/inbiz:20220825144944_b32cf062d1b604e9
#    image: 192.168.251.78/edoc2v5/inbiz:20220826220237_436fd740fee2e92e
#    image: 192.168.251.78/edoc2v5/inbiz:20220829094628_8ef864f2d5dd6f7d
#    image: 192.168.251.78/edoc2v5/inbiz:20220831152204_269eb22e4e038639
#    image: 192.168.251.78/edoc2v5/inbiz:20220928185437_df142b2ca04f139c
#    image: 192.168.251.78/edoc2v5/inbiz:20221012143605_b54efe3113524880
#    image: 192.168.251.78/edoc2v5/inbiz:20221013142008_ccea7c327c133830
#    image: 192.168.251.78/edoc2v5/inbiz:20221014101010_c13441feef453350
#    image: 192.168.251.78/edoc2v5/inbiz:20221014130231_1ae56b9fda14a024
#    image: 192.168.251.78/edoc2v5/inbiz:20221014150927_67428d5911962739
#    image: 192.168.251.78/edoc2v5/inbiz:20221018105602_6800e94f8fc99ffe
    image: 192.168.251.78/edoc2v5/inbiz:20221024103746_797915cd6bafdf59
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      # - LogFormatType=KB
      # - InBizHttpServicePort=5006
      # - InBizGrpcServicePort=15006
    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.0.0.0-beta1
    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.0.0.0-beta1
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      - INBIZINITDATABASE=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.0.0.0-beta1
    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
    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-frontend:
    hostname: inbiz-frontend
    image: registry.edoc2.com:5000/edoc2v5/inbiz-frontend:inbiz-v6.0.0.0-beta1
    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"
#   wf:
#     image: registry.edoc2.com:5000/edoc2v5/wf:inbiz-v6.0.0.0-beta1
#     labels:
#       "type": "2"
#     networks:
#       - edoc2
#     environment:
#       - swaggerEnable=false
#     env_file:
#       ./envfile.env
#     cap_add:
#       - SYS_PTRACE
#     deploy:
#       replicas: 1
#       placement:
#         constraints:
#           - node.labels.nodetype == InDrive
#       restart_policy:
#         condition: on-failure
# #    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
