version: '3.5'

services:
  edoc2:
    hostname: edoc2
    image: registry.edoc2.com:5000/edoc2v5/edoc2:ecm-HUAWEI-v5.16.0.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
      - NUMS=25
      - ThreadCheck=true
    env_file:
      ./envfile.env
    networks:
      - edoc2
    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
#      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"

  transport:
    hostname: transport
    image: registry.edoc2.com:5000/edoc2v5/transport:ecm-HUAWEI-v5.16.0.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: any

  wf:
    image: registry.edoc2.com:5000/edoc2v5/wf:ecm-HUAWEI-v5.16.0.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: 192.168.251.78/edoc2v5/regionsync:20210521100708_5e0827008104784c
#    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

#  storagetransfer:
#    hostname: storagetransfer
#    image: 192.168.251.78/edoc2v5/storagetransfer:{storagetransfer}
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    networks: 
#      - edoc2
#    labels:
#      "type": "1"
#    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-HUAWEI-v5.16.0.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: 192.168.251.78/edoc2v5/importsync:{importsync}
#    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-HUAWEI-v5.16.0.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
      resources:
        limits:
          cpus: '4'
          memory: 8G
    env_file:
      ./envfile.env
#    environment:
#      - ESURL=http://es:9200
#      - enable_clamav=true

# regionclearcopy:
#   hostname: regionclearcopy
#   image: 192.168.251.78/edoc2v5/regionclearcopy:{regionclearcopy}
#   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
#   env_file:
#     ./envfile.env

#  unionsync:
#    hostname: unionsync
#    image: 192.168.251.78/edoc2v5/unionsync:20210521100708_5e0827008104784c
#    labels:
#      "type": "1"
#    networks:
#      - edoc2
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure

#  encryption:
#    image: 192.168.251.78/edoc2v5/encryption:20210521100708_5e0827008104784c
#    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: 192.168.251.78/edoc2v5/nginx:v1.18.0-huawei-20210301
#    image: 192.168.251.78/edoc2v5/nginx:v1.18.0-huawei-20210325
    image: registry.edoc2.com:5000/edoc2v5/nginx:ecm-HUAWEI-v5.16.0.1
    ports:
      - target: 80
        published: 80
        mode: host
#      - target: 443
#        published: 443
#        mode: host
    environment:
      - WF=true
#      - SEARCHENGINE=true
#      - UDCMGT=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: 192.168.251.78/library/clamav:latest
#    labels:
#      "type": "0"
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#    networks:
#      - edoc2

#  weboffice:
#    hostname: weboffice
#    image: 192.168.251.78/edoc2v5/weboffice:20210106_610
##    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: 192.168.251.78/edoc2v5/wordtemplate:v3.7
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#    networks:
#      - edoc2

#  number:
#    hostname: number
#    image: 192.168.251.78/edoc2v5/number:512
#    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: 192.168.251.78/edoc2v5/insight:20200528095635
#    ports:
#      - "8001:80"
#    environment:
#      - ASPNETCORE_ENVIRONMENT=Production
#    networks:
#      - edoc2
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure

#  inwise:
#    hostname: inwise
##    image: 192.168.251.78/edoc2v5/inwise:20210128202512
#    image: 192.168.251.78/edoc2v5/inwise:20210305140103
##    ports:
##      - "8089:8088"
#    environment:
#      - INWISE_URL=http://inwise:8088
#      - EDOC2_URL=http://edoc2
#      - EDOC2_USER=admin
#      - EDOC2_PASSWORD=edoc2
#      - DEBUG=true
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/inwise:/data
#    networks:
#      - edoc2
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
networks:
  edoc2:
    external: true
    name: macrowing

