version: '3.5'

services:
  edrmscore:
    hostname: edrmscore
    image: registry.edoc2.com:5000/edoc2v5/edrmscore:edrms-v5.18.0.0
    env_file:
      ./envfile.env
    ports:
      - "5005:5005"
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
    networks:
      - edoc2

  inbiz:
    hostname: inbiz
    image: registry.edoc2.com:5000/edoc2v5/inbiz:edrms-v5.18.0.0
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      - ASPNETCORE_ENVIRONMENT=Production
      - CONVERT2KTO4K=true
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  initdatabase:
    hostname: initdatabase
    image: registry.edoc2.com:5000/edoc2v5/initdatabase:edrms-v5.18.0.0
    labels:
      "type": "1"
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    env_file:
      ./envfile.env
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  auth:
    hostname: auth
    image: registry.edoc2.com:5000/edoc2v5/auth:edrms-v5.18.0.0
    env_file: ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: any
    healthcheck:
      test: curl -L -k -i http://localhost:6320/api/values|grep "200 OK"
      interval: 10s
      timeout: 3s
      retries: 3
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  perm:
    hostname: perm
    image: registry.edoc2.com:5000/edoc2v5/perm:edrms-v5.18.0.0
    env_file: ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: any
    healthcheck:
      test: curl -L -k -i http://localhost:6330/api/values|grep "200 OK"
      interval: 10s
      timeout: 3s
      retries: 3
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  edoc2:
    hostname: edoc2
    image: registry.edoc2.com:5000/edoc2v5/edoc2:edrms-v5.18.0.0
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      - PUBLISH_EXTERNAL_ADDRESS=http://localhost/
      - PRODUCTION=EDRMS
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    stop_signal: SIGKILL
    healthcheck:
      test: /bin/bash /opt/edoc2_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
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  content:
    image: registry.edoc2.com:5000/edoc2v5/content:edrms-v5.18.0.0
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    labels:
      "type": "1"
    networks:
      - edoc2
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
      resources:
        limits:
          cpus: '4'
          memory: 8G
    environment:
      - IndexPushMQQueueName=index_erms_queue
      - IndexPushMQFolderCode=edrmsFolderCode
      - InWiseIndexQueueName=index_erms_queue
    env_file:
      ./envfile.env
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  transport:
    hostname: transport
    image: registry.edoc2.com:5000/edoc2v5/transport:edrms-v5.18.0.0
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    healthcheck:
      test: curl -L -k -i http://localhost:6261/api/values|grep "200 OK"
      interval: 10s
      timeout: 3s
      retries: 3
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: any
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  wf:
    image: registry.edoc2.com:5000/edoc2v5/wf:edrms-v5.18.0.0
    labels:
      "type": "2"
    networks:
      - edoc2
    env_file:
      ./envfile.env
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  org:
    hostname: org
    image: registry.edoc2.com:5000/edoc2v5/org:edrms-v5.18.0.0
    env_file: ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: any
    healthcheck:
      test: curl -L -k -i http://localhost:6310/api/values|grep "200 OK"
      interval: 10s
      timeout: 3s
      retries: 3
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  orgsync:
    hostname: orgsync
    image: registry.edoc2.com:5000/edoc2v5/orgsync:edrms-v5.18.0.0
    labels:
      "type": "1"
    networks:
      - edoc2
    environment:
      - ISTITLE=0
    cap_add:
      - SYS_PTRACE
    env_file:
      ./envfile.env
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  nginx:
    hostname: nginx
    image: registry.edoc2.com:5000/edoc2v5/nginx:edrms-v5.18.0.0
    ports:
      - target: 80
        published: 80
        mode: host
    environment:
      - WORDTEMPLATE=true
      - WF=true
      - EDRMSCORE=true
      - SEARCHENGINE=true
      - INBIZ=true
      - LB_RR=true
    labels:
      "type": "0"
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      restart_policy:
        condition: on-failure
    networks:
      - edoc2
    healthcheck:
      test: bash /opt/nginx/check.sh
      interval: 20s
      timeout: 10s
      retries: 3
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  wordtemplate:
    hostname: wordtemplate
    image: registry.edoc2.com:5000/edoc2v5/wordtemplate:edrms-v5.18.0.0
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure
    networks:
      - edoc2
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"

  searchengine:
    hostname: searchengine
    image: registry.edoc2.com:5000/edoc2v5/searchengine:edrms-v5.18.0.0
    labels:
      "type": "2"
    environment:
      - ASPNETCORE_ENVIRONMENT=Production
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
networks:
  edoc2:
    external: true
    name: macrowing

