version: '3.5'
services:
  initdatabase:
    hostname: initdatabase
    image: registry.edoc2.com:5000/edoc2v5/initdatabase:edrms-v6.5.0.1-rc11-arm
    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
      endpoint_mode: dnsrr
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  edoc2:
    hostname: edoc2
    image: registry.edoc2.com:5000/edoc2v5/edoc2:edrms-v6.5.0.1-rc11-arm
    #ports:
    #  - "5002:5002"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /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
    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
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  transport:
    hostname: transport
    image: registry.edoc2.com:5000/edoc2v5/transport:edrms-v6.5.0.1-rc11-arm
    #ports:
    #  - "6261:6261"
#    ports:
#      - target:6261
#        published:6261
#        mode:host
    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
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: any
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
    healthcheck:
      test: curl -L -k -i http://localhost:6261/api/values|grep "200 OK"
      interval: 10s
      timeout: 3s
      retries: 3
  auth:
    hostname: auth
    image: registry.edoc2.com:5000/edoc2v5/auth:edrms-v6.5.0.1-rc11-arm
    #ports:
    #  - "6320:6320"
    #  - "16320:16320"
    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
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
    healthcheck:
      test: curl -L -k -i http://localhost:6320/api/values|grep "200 OK"
      interval: 10s
      timeout: 3s
      retries: 3
  org:
    hostname: org
    image: registry.edoc2.com:5000/edoc2v5/org:edrms-v6.5.0.1-rc11-arm
    #ports:
    #  - "6310:6310"
    #  - "16310:16310"
    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
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
    healthcheck:
      test: curl -L -k -i http://localhost:6310/api/values|grep "200 OK"
      interval: 10s
      timeout: 3s
      retries: 3
  perm:
    hostname: perm
    image: registry.edoc2.com:5000/edoc2v5/perm:edrms-v6.5.0.1-rc11-arm
    #ports:
    #  - target:6330
    #    published:6330
    #    mode:host
    #  - target:16330
    #    published:16330
    #    mode:host
    env_file: ./envfile.env
    #ports:
    #  - 6330:6330
    #  - 16330:16330
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: any
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
    healthcheck:
      test: curl -L -k -i http://localhost:6330/api/values|grep "200 OK"
      interval: 10s
      timeout: 3s
      retries: 3
  orgsync:
    hostname: orgsync
    image: registry.edoc2.com:5000/edoc2v5/orgsync:edrms-v6.5.0.1-rc11-arm
    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
      endpoint_mode: dnsrr        
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  content:
    hostname: content
    image: registry.edoc2.com:5000/edoc2v5/content:edrms-v6.5.0.1-rc11-arm
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    labels:
      "type": "1"
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    env_file:
      ./envfile.env
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
      resources:
        limits:
          cpus: '4'
          memory: 8G
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  watermark:
    hostname: watermark
    image: registry.edoc2.com:5000/edoc2v5/watermark:edrms-v6.5.0.1-rc11-arm
    labels:
      "type": "2"
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/edoc2Docs:/edoc2Docs
    networks: 
      - edoc2
    cap_add:
      - SYS_PTRACE
    env_file:
      ./envfile.env
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
      endpoint_mode: dnsrr
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  ecmweb:
    hostname: ecmweb
    image: registry.edoc2.com:5000/edoc2v5/ecmweb:edrms-v6.5.0.1-rc11
    environment:
      # 开启dump日志
      - LB_RR=true
      # 开启搜索
      - SHARESTORAGE=true
      # 关闭clientasync服务
      - CLIENTSYNC=false
      # 关闭isp
      - ISP=false
      # 关闭inwise
      - INWISE=false
    labels:
      "type": "0"
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      mode: global
      restart_policy:
        condition: on-failure
      endpoint_mode: dnsrr
    networks:
      - edoc2
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  nginx:
    hostname: nginx
    image: registry.edoc2.com:5000/edoc2v5/nginx:edrms-v6.5.0.1-rc11-arm
    # volumes:
    #   - /opt/docker-compose/nginx:/opt/nginx
    ports:
      - target: 80
        published: 80
        mode: host
    environment:
      # 开启ECM
      - ECM=true
      # 开启 inbiz
      - INBIZ=true
      # 开启档案
      - EDRMSV6=true
      # 关闭开发云
      - DEVCLOUDENABLE=false
    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"
        
networks:
  edoc2:
    external: true
    name: macrowing
