version: '3.5'

services:
### SVC:initdatabase:>>> Don't delete
  initdatabase:
    hostname: initdatabase
    image: registry.edoc2.com:5000/edoc2v5/initdatabase:inbiz-v5.18.3.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"
### SVC:initdatabase:<<< Don't delete
### SVC:edoc2:>>> Don't delete
  edoc2:
    hostname: edoc2
    image: registry.edoc2.com:5000/edoc2v5/edoc2:inbiz-v5.18.3.0
    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
    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
#      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"
### SVC:edoc2:<<< Don't delete
### SVC:decryption:>>> Don't delete
  decryption:
    hostname: decryption
    image: registry.edoc2.com:5000/edoc2v5/decryption:inbiz-v5.18.3.0
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    env_file: ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      endpoint_mode: dnsrr
      restart_policy:
        condition: any
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:decryption:<<< Don't delete
### SVC:transport:>>> Don't delete
  transport:
    hostname: transport
    image: registry.edoc2.com:5000/edoc2v5/transport:inbiz-v5.18.3.0
#    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
    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:6261/api/values|grep "200 OK"
      interval: 10s
      timeout: 3s
      retries: 3
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:transport:<<< Don't delete
### SVC:auth:>>> Don't delete
  auth:
    hostname: auth
    image: registry.edoc2.com:5000/edoc2v5/auth:inbiz-v5.18.3.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"
### SVC:auth:<<< Don't delete
### SVC:org:>>> Don't delete
  org:
    hostname: org
    image: registry.edoc2.com:5000/edoc2v5/org:inbiz-v5.18.3.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"
### SVC:org:<<< Don't delete
### SVC:perm:>>> Don't delete
  perm:
    hostname: perm
    image: registry.edoc2.com:5000/edoc2v5/perm:inbiz-v5.18.3.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"
### SVC:perm:<<< Don't delete
### SVC:wf:>>> Don't delete
  wf:
    image: registry.edoc2.com:5000/edoc2v5/wf:inbiz-v5.18.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"
### SVC:wf:<<< Don't delete

### SVC:regionsync:>>> Don't delete
#  regionsync:
#    hostname: regionsync
#    image: registry.edoc2.com:5000/edoc2v5/regionsync:inbiz-v5.18.3.0
#    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
#    logging:
#      driver: "json-file"
#      options:
#        max-size: "2000k"
#        max-file: "10"
### SVC:regionsync:<<< Don't delete

### SVC:storagetransfer:>>> Don't delete
#  storagetransfer:
#    hostname: storagetransfer
#    image: registry.edoc2.com:5000/edoc2v5/storagetransfer:inbiz-v5.18.3.0
#    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
#    logging:
#      driver: "json-file"
#      options:
#        max-size: "2000k"
#        max-file: "10"
### SVC:storagetransfer:<<< Don't delete

### SVC:orgsync:>>> Don't delete
  orgsync:
    hostname: orgsync
    image: registry.edoc2.com:5000/edoc2v5/orgsync:inbiz-v5.18.3.0
    labels:
      "type": "1"
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    environment:
      - ISTITLE=0
    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"
### SVC:orgsync:<<< Don't delete

### SVC:importsync:>>> Don't delete
#  importsync:
#    hostname: importsync
#    image: registry.edoc2.com:5000/edoc2v5/importsync:inbiz-v5.18.3.0
#    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
#    logging:
#      driver: "json-file"
#      options:
#        max-size: "2000k"
#        max-file: "10"
### SVC:importsync:<<< Don't delete

### SVC:content:>>> Don't delete
  content:
    image: registry.edoc2.com:5000/edoc2v5/content:inbiz-v5.18.3.0
#    ports:
#      - target: 5011
#        published: 5011
#        mode: host
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#      - /home/edoc2/macrowing/edoc2v5/data/office:/app/Contents/Conversion/microsoft_docs
#      - /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
    cap_add:
      - SYS_PTRACE
    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
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:content:<<< Don't delete

### SVC:regionclearcopy:>>> Don't delete
#  regionclearcopy:
#    hostname: regionclearcopy
#    image: registry.edoc2.com:5000/edoc2v5/regionclearcopy:inbiz-v5.18.3.0
#    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
#    logging:
#      driver: "json-file"
#      options:
#        max-size: "2000k"
#        max-file: "10"
### SVC:regionclearcopy:<<< Don't delete

### SVC:unionsync:>>> Don't delete
#  unionsync:
#    hostname: unionsync
#    image: registry.edoc2.com:5000/edoc2v5/unionsync:inbiz-v5.18.3.0
#    labels:
#      "type": "1"
#    networks:
#      - edoc2
#    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"
### SVC:unionsync:<<< Don't delete

### SVC:nginx:>>> Don't delete
  nginx: 
    hostname: nginx
    image: registry.edoc2.com:5000/edoc2v5/nginx:inbiz-v5.18.3.0
    ports:
      - target: 80
        published: 80
        mode: host
#      - target: 443
#        published: 443
#        mode: host
    environment:
      - INBIZ=true
      - WF=true
      - LB_RR=true
#      - SEARCHENGINE=true
#      - UDCMGT=true
#      - WEBOFFICE=true
#      - INSIGHT=true
#      - INBIZTHIRD=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: bash /opt/nginx/check.sh
      interval: 20s
      timeout: 10s
      retries: 3
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:nginx:<<< Don't delete

### SVC:weboffice:>>> Don't delete
#  weboffice:
#    hostname: weboffice
#    image: registry.edoc2.com:5000/edoc2v5/weboffice:inbiz-v5.18.3.0
#    volumes:
#      - /datavol/weboffice/Data:/var/www/onlyoffice/Data
#      - /datavol/weboffice/onlyoffice:/var/lib/onlyoffice
#      - /datavol/weboffice/postgresql:/var/lib/postgresql
#      - /datavol/weboffice/log:/var/log/onlyoffice
##    ports:
##      - "5001:80"
#    labels:
#      "type": "0"
#    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
### SVC:weboffice:<<< Don't delete

networks:
  edoc2:
    external: true
    name: macrowing

