version: '3.5'

services:
  edoc2:
    hostname: edoc2
    image: registry.edoc2.com:5000/edoc2v5/edoc2:ecm-Centerm-v513.8.1
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2:/app/wwwroot/external
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    labels:
      "type": "1"
    environment:
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      - PUBLISH_EXTERNAL_ADDRESS=http://localhost/
      - PRODUCTION=edoc2
    env_file:
      ./envfile.env
    networks:
      - edoc2
    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"
  authuserapi:
    hostname: authuserapi
    image: registry.edoc2.com:5000/edoc2v5/authuserapi:ecm-Centerm-v513.8.1
    ports:
      - 9010:9010
    networks:
      - edoc2
    labels:
      "type": "1"
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
  edocorgsync:
    hostname: edocorgsync
    image: registry.edoc2.com:5000/edoc2v5/corgsync:ecm-Centerm-v513.8.1
    volumes:
      - /opt/appsettings.json:/app/appsettings.json
 #     - /opt/quartz_jobs.xml:/app/quartz_jobs.xml
    ports:
      - 9011:9011
    networks:
      - edoc2
    labels:
      "type": "1"
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
  extension:
    hostname: extension
    image: registry.edoc2.com:5000/edoc2v5/cextension:ecm-Centerm-v513.8.1
    volumes:
      - /opt/appsettings.json:/app/appsettings.json
    ports:
      - 9012:9012
    networks:
      - edoc2
    labels:
      "type": "1"
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure

  transport:
    hostname: transport
    image: registry.edoc2.com:5000/edoc2v5/transport:ecm-Centerm-v513.8.1
#    ports:
#      - target: 6261
#        published: 6261
#        mode: host
    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2:/app/wwwroot/external
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    env_file:
      ./envfile.env
    networks:
      - edoc2
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
  wf:
    image: registry.edoc2.com:5000/edoc2v5/wf:ecm-Centerm-v513.8.1
    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"
#  regionsync:
#    hostname: regionsync
#    image: registry.edoc2.com:5000/edoc2v5/regionsync:ecm-Centerm-v513.8.1
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    labels:
#      "type": "1"
#    networks:
#      - edoc2
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
  orgsync:
    hostname: orgsync
    image: registry.edoc2.com:5000/edoc2v5/orgsync:ecm-Centerm-v513.8.1
    labels:
      "type": "1"
    networks:
      - edoc2
    environment:
      - ISTITLE=0
    env_file:
      ./envfile.env
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure
#  importsync:
#    hostname: importsync
#    image: registry.edoc2.com:5000/edoc2v5/importsync:ecm-Centerm-v513.8.1
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    labels:
#      "type": "1"
#    networks:
#      - edoc2
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
  content:
    image: registry.edoc2.com:5000/edoc2v5/content:ecm-Centerm-v513.8.1
#    ports:
#      - target: 5011
#        published: 5011
#        mode: host
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#      - /home/edoc2/macrowing/edoc2v5/data/aboutpip:/app/aboutpip/aboutpip
#      - /home/edoc2/macrowing/edoc2v5/data/detection_ocr:/app/detection_ocr/detection_ocr
    labels:
      "type": "1"
    networks:
      - edoc2
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
    env_file:
      ./envfile.env
    #environment:
      #- ESURL=http://es:9200
#      - enable_clamav=true

#  unionsync:
#    hostname: unionsync
#    image: registry.edoc2.com:5000/edoc2v5/unionsync:ecm-Centerm-v513.8.1
#    labels:
#      "type": "1"
#    networks:
#      - edoc2
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure

#  encryption:
#    image: registry.edoc2.com:5000/edoc2v5/encryption:ecm-Centerm-v513.8.1
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    labels:
#      "type": "1"
#    networks:
#      - edoc2
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
  nginx: 
    hostname: nginx
    image: registry.edoc2.com:5000/edoc2v5/nginx:ecm-Centerm-v513.8.1
    ports:
      - target: 80
        published: 80
        mode: host
#      - target: 443
#        published: 443
#        mode: host
    environment:
      - WF=true
      - WEBOFFICE=true
#      - INSIGHT=true
#      - SSL=true
#      - DOMAIN_NAME=ab.edoc2.com
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data:/etc/nginx/cert
    labels:
      "type": "0"
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      restart_policy:
        condition: on-failure
    networks:
      - edoc2
    healthcheck:
      test: curl -L -k -i http://localhost/api/values|grep "200 OK"
      interval: 20s
      timeout: 10s
      retries: 3
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  clamav:
    hostname: clamav
    image: registry.edoc2.com:5000/library/clamav:ecm-Centerm-v513.8.1
    labels:
      "type": "0"
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure
    networks:
      - edoc2

  weboffice:
    hostname: weboffice
    image: registry.edoc2.com:5000/edoc2v5/weboffice:ecm-Centerm-v513.8.1
#    ports:
#      - "5001:80"
    labels:
      "type": "0"
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure
    networks:
      - edoc2

#  wordtemplate:
#    hostname: wordtemplate
#    image: registry.edoc2.com:5000/edoc2v5/wordtemplate:ecm-Centerm-v513.8.1
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#    networks:
#      - edoc2
#
#  number:
#    hostname: number
#    image: registry.edoc2.com:5000/edoc2v5/number:ecm-Centerm-v513.8.1
#    environment:
#      - siteName=edrms
#    ports:
#      - "8002:80"
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#    networks:
#      - edoc2
#
#  insight:
#    hostname: insight
#    image: registry.edoc2.com:5000/edoc2v5/insight:ecm-Centerm-v513.8.1
#    ports:
#      - "8001:80"
#    environment:
#      - ASPNETCORE_ENVIRONMENT=Production
#    networks:
#      - edoc2
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#  udcmgt:
#     hostname: udcmgt
#     image: registry.edoc2.com:5000/edoc2v5/ingest:ecm-Centerm-v513.8.1
#     volumes:
#       - /home/edoc2/macrowing/edoc2v5/data/udcmgt:/app/wwwroot/external
##     environment:
##        - DatabasePassword=1qaz1QAZ2wsx2WSX
##        - DatabaseServerName=172.16.1.32
##        - DatabaseType=3
##        - DatabaseUserName=wf
##        - DatabaseServerPort=3306
##        - ECMURL=http://edoc2
##        - ECM_IntegrationKey=46aa92ec-66af-4818-b7c1-8495a9bd7f1
##        - ESURL=http://es:9200
#     env_file:
#       ./envfile.env
#     labels:
#       "type": "1"
#     networks:
#       - edoc2
networks:
  edoc2:
    external: true
    name: macrowing

