version: "3.5"

services:
  inbiz:
    hostname: inbiz
    image: registry.edoc2.com:5000/edoc2v5/inbiz:inbiz-v5.17.3.0
    environment:
      - LOGGER_ISDEBUG=true
      - LOGGER_MINCALLTIMESPAN=1000
      - ASPNETCORE_ENVIRONMENT=Production
    env_file: 
      ./envfile.env
    networks:
      - edoc2
    stop_signal: SIGKILL
    healthcheck:
      test: /bin/bash /opt/inbiz_check.sh
      interval: 15s
      timeout: 10s
      retries: 3
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      endpoint_mode: dnsrr
      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"

  wf:
    image: registry.edoc2.com:5000/edoc2v5/wf:inbiz-v5.17.3.0
    labels:
      "type": "2"
    networks:
      - edoc2
    env_file:
      ./envfile.env
    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"

#   searchengine:
#     hostname: searchengine
#     image: registry.edoc2.com:5000/edoc2v5/searchengine:inbiz-v5.17.3.0
#     labels:
#       "type": "2"
#     environment: 
#      - ASPNETCORE_ENVIRONMENT=Production
# #    - INSIGHT=1
# #    - ECMURL=http://edoc2
# #    - ESURL=http://es:9200
# #    - INBIZURL=http://inbiz
#     env_file:
#       ./envfile.env
#     networks: 
#       - edoc2
#     deploy:
#       replicas: 1
#       restart_policy:
#         condition: on-failure

networks:
  edoc2:
    external: true
    name: macrowing
