version: '3.5'

services:
### SVC:edoc2:>>> Don't delete
  edoc2:
    hostname: edoc2
    image: registry.edoc2.com:5000/edoc2v5/edoc2region:inbiz-region-inbiz-test-v9.9.0.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:
      - CACHEMODULE=redis
      - STORAGEPLATFORM=0
      # 区域的传输地址
#      - Region_TSAP={Region_TSAP}
      - S3_Url=S3URL
      - S3_SecretKey=S3SECRET
      - S3_AccessKey=S3ACCESS
      - S3_Bucket=S3BUCKET
      - OSS_ISCNAME=false
      # S3的签名版本，2或4，默认4
      - S3_SignatureVersion=4
      - Ceph_HealthUrl=S3HealthUrl
      - LOGGER_ISDEBUG=false
      - LOGGER_MINCALLTIMESPAN=1000
      - HTTP_PROTOCOL_TYPE=http
      - PRODUCTION=edoc2
      - REGISTERCODE={REGISTERCODE}
      - REGIONID={REGIONID}
      - REGIONURL={REGIONURL}
      - PRIMARYURL={PRIMARYURL}
      - INTRANETADDRESS={INTRANETADDRESS}
    networks:
      - edoc2region
    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'
#          memory: 32G
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:edoc2:<<< Don't delete

### SVC:transport:>>> Don't delete
  transport:
    hostname: transport
    image: registry.edoc2.com:5000/edoc2v5/transport:inbiz-region-inbiz-test-v9.9.0.0
    environment:
      - CACHEMODULE=redis
#    ports:
#      - target: 6261
#        published: 6261
#        mode: host
    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2:/app/wwwroot/external
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    networks: 
      - edoc2region
    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
#      resources:
#        limits:
#          memory: 24G
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:transport:<<< Don't delete

### SVC:nginx:>>> Don't delete
  nginx: 
    hostname: nginx
    image: registry.edoc2.com:5000/edoc2v5/nginx:inbiz-region-inbiz-test-v9.9.0.0
    ports:
      - target: 80
        published: 80
        mode: host
#      - target: 443
#        published: 443
#        mode: host
    environment:
      - REGION=true
      - LB_RR=true
#      - COLLAB=standalone
#      - DOCFLOW=true
#      - UDCMGT=true
#      - WEBOFFICE=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: 
      - edoc2region
    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"
### SVC:nginx:<<< Don't delete

### SVC:redis:>>> Don't delete
  redis:
    hostname: redis
    image: registry.edoc2.com:5000/edoc2v5/redis:inbiz-region-inbiz-test-v9.9.0.0
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/redis:/data
    networks:
      - edoc2region
    environment:
      - PASS=ZgDSvOoY5Q
    deploy:
      replicas: 1
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2048k"
        max-file: "10"
### SVC:redis:<<< Don't delete

### SVC:storagetransfer:>>> Don't delete
#  storagetransfer:
#    hostname: storagetransfer
#    image: registry.edoc2.com:5000/edoc2v5/storagetransfer:inbiz-region-inbiz-test-v9.9.0.0
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    networks:
#      - edoc2region
#    labels:
#      "type": "1"
#    deploy:
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#      resources:
#        limits:
#          memory: 24G
#    logging:
#      driver: "json-file"
#      options:
#        max-size: "2000k"
#        max-file: "10"
### SVC:storagetransfer:<<< Don't delete

#### SVC:importsync:>>> Don't delete
#  importsync:
#    hostname: importsync
#    image: registry.edoc2.com:5000/edoc2v5/importsync:inbiz-region-inbiz-test-v9.9.0.0
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    labels:
#      "type": "1"
#    networks:
#      - edoc2region
#    deploy:
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#      resources:
#        limits:
#          memory: 24G
#    logging:
#      driver: "json-file"
#      options:
#        max-size: "2000k"
#        max-file: "10"
### SVC:importsync:<<< Don't delete

### SVC:regionsync:>>> Don't delete
#  regionsync:
#    hostname: regionsync
#    image: registry.edoc2.com:5000/edoc2v5/regionsync:inbiz-region-inbiz-test-v9.9.0.0
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    labels:
#      "type": "1"
#    networks:
#      - edoc2region
#    deploy:
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#      resources:
#        limits:
#          memory: 24G
#    logging:
#      driver: "json-file"
#      options:
#        max-size: "2000k"
#        max-file: "10"
### SVC:regionsync:<<< Don't delete

### SVC:content:>>> Don't delete
  content:
    hostname: content
    image: registry.edoc2.com:5000/edoc2v5/content:inbiz-region-inbiz-test-v9.9.0.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: 
      - edoc2region
    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: 16G
#    environment:
#      - 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-region-inbiz-test-v9.9.0.0
#    volumes:
#      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
#    labels:
#      "type": "1"
#    networks: 
#      - edoc2region
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#      resources:
#        limits:
#          memory: 16G
#    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-region-inbiz-test-v9.9.0.0
#    labels:
#      "type": "1"
#    networks:
#      - edoc2region
#    deploy:
#      placement:
#        constraints:
#          - node.labels.nodetype == InDrive
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#      resources:
#        limits:
#          memory: 24G
#    logging:
#      driver: "json-file"
#      options:
#        max-size: "2000k"
#        max-file: "10"
### SVC:unionsync:<<< Don't delete

### SVC:weboffice:>>> Don't delete
#  weboffice:
#    hostname: weboffice
#    image: registry.edoc2.com:5000/edoc2v5/weboffice:inbiz-region-inbiz-test-v9.9.0.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:
#      replicas: 1
#      restart_policy:
#        condition: on-failure
#    logging:
#      driver: "json-file"
#      options:
#        max-size: "2000k"
#        max-file: "10"
#    networks: 
#      - edoc2region
### SVC:weboffice:<<< Don't delete

### SVC:decryption:>>> Don't delete
  decryption:
    hostname: decryption
    image: registry.edoc2.com:5000/edoc2v5/decryption:inbiz-region-inbiz-test-v9.9.0.0
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    labels:
      "type": "1"
    networks: 
      - edoc2region
    cap_add:
      - SYS_PTRACE
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure
#      resources:
#        limits:
#          memory: 24G
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:decryption:<<< Don't delete
### SVC:watermark:>>> Don't delete
  watermark:
    hostname: watermark
    image: registry.edoc2.com:5000/edoc2v5/watermark:inbiz-region-inbiz-test-v9.9.0.0
    labels:
      "type": "2"
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    networks: 
      - edoc2region
    cap_add:
      - SYS_PTRACE
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:watermark:<<< Don't delete


networks:
  edoc2region:
    external: true
    name: macrowing
