version: '3.5'

services:
  edoc2:
    hostname: edoc2
    image: registry.edoc2.com:5000/edoc2v5/edoc2:topsec-ecm-v5121-20200624
    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"
  transport:
    hostname: transport
    image: registry.edoc2.com:5000/edoc2v5/transport:topsec-ecm-v5121-20200624
#    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:topsec-ecm-v5121-20200624
    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:topsec-ecm-v5121-20200624
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    labels:
#      "type": "1"
#    networks:
#      - edoc2
#    deploy:
#      replicas: 1
#      restart_policy:
#        condition: on-failure
  orgsync:
    hostname: orgsync
    image: registry.edoc2.com:5000/edoc2v5/orgsync:topsec-ecm-v5121-20200624
    labels:
      "type": "1"
    networks:
      - edoc2
    environment:
      - ISTITLE=0
    env_file:
      ./envfile.env
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
#  importsync:
#    hostname: importsync
#    image: registry.edoc2.com:5000/edoc2v5/importsync:topsec-ecm-v5121-20200624
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    labels:
#      "type": "1"
#    networks:
#      - edoc2
#    deploy:
#      replicas: 1
#      restart_policy:
#        condition: on-failure
  content:
    image: registry.edoc2.com:5000/edoc2v5/content:topsec-ecm-v5121-20200624
#    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:topsec-ecm-v5121-20200624
#    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:topsec-ecm-v5121-20200624
#    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:topsec-ecm-v5121-20200624
    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:topsec-ecm-v5121-20200624
#    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:topsec-ecm-v5121-20200624
##    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:topsec-ecm-v5121-20200624
#    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:topsec-ecm-v5121-20200624
#    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:topsec-ecm-v5121-20200624
#    ports:
#      - "8001:80"
#    environment:
#      - ASPNETCORE_ENVIRONMENT=Production
#    networks:
#      - edoc2
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure

networks:
  edoc2:
    external: true
    name: macrowing

