version: '3.5'

services:
  edrms-api:
    hostname: edrms-api
    image: registry.edoc2.com:5000/edoc2v5/edrms-api:edrms-v6.5.0.3
    labels:
      "type": "2"
    environment:
      - ServerModule=webapi
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
      placement:
        constraints:
          - node.labels.nodetype == InDrive
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  edrms-ioservice:
    hostname: edrms-ioservice
    image: registry.edoc2.com:5000/edoc2v5/edrms-api:edrms-v6.5.0.3
    labels:
      "type": "2"
    environment:
      - ServerModule=ioservice
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
      placement:
        constraints:
          - node.labels.nodetype == InDrive
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  edrms-backend:
    hostname: edrms-backend
    image: registry.edoc2.com:5000/edoc2v5/edrms-api:edrms-v6.5.0.3
    labels:
      "type": "2"
    environment:
      - ServerModule=backend
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      mode: global
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
      placement:
        constraints:
          - node.labels.nodetype == InDrive
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  edrms-datainit:
    hostname: edrms-datainit
    image: registry.edoc2.com:5000/edoc2v5/edrms-api:edrms-v6.5.0.3
    labels:
      "type": "2"
    environment:
      - ServerModule=datainit
    env_file:
      ./envfile.env
    networks:
      - edoc2
    cap_add:
      - SYS_PTRACE
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      endpoint_mode: dnsrr
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
  edrms-tool:
    hostname: edrms-tool
    image: registry.edoc2.com:5000/edoc2v5/edrms-tool:edrms-v6.5.0.3
    env_file:
      ./envfile.env
    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"
    networks:
      - edoc2
  edrms-storageroom:
    hostname: edrms-storageroom
    image:  registry.edoc2.com:5000/edoc2v5/edrms-storageroom:edrms-v6.5.0.3
    env_file:
      ./envfile.env
    cap_add:
      - SYS_PTRACE
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      endpoint_mode: dnsrr
      mode: global
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
    networks:
      - edoc2
  sharestorage:
    hostname: sharestorage
    image: registry.edoc2.com:5000/edoc2v5/edrms-sharestorage:edrms-v6.5.0.3
    env_file:
      ./envfile.env
    volumes:
      - /home/edoc2/macrowing/edoc2v5/data/sharestorage:/sharestorage
    networks:
      - edoc2
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
    logging:
      driver: "json-file"
      options:
        max-size: "2048k"
        max-file: "10"
  edrmsweb:
    hostname: edrmsweb
    image: registry.edoc2.com:5000/edoc2v5/edrmsweb:edrms-v6.5.0.3
    # environment:
    #   # edrms-api服务端口
    #   - EDRMSApiHttpPort=80
    #   # edrms-ioservice服务端口
    #   - EDRMSIoserviceHttpPort=80
    #   # edrms-datainit服务端口
    #   - EDRMSDatainitHttpPort=80
    #    # edrms-storageroom服务ng转发端口,默认80
    #   - STORAGE_SERVER_PORT=80
    #   # edrms-tool服务ng转发端口,默认80
    #   - TOOL_SERVER_PORT=80
    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"
networks:
  edoc2:
    external: true
    name: macrowing
