version: '3.5'

services:
  edoc2:
    hostname: edoc2
    image: 192.168.251.78/edoc2v5/edoc2:20200801150630
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
#      - /opt/edoc2/ZHF/edoc2v5/data/edoc2:/app/wwwroot/external
      - /opt/edoc2/ZHF/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: 192.168.251.78/edoc2v5/transport:20200801145910
#    ports:
#      - target: 6261
#        published: 6261
#        mode: host
    volumes:
#      - /opt/edoc2/ZHF/edoc2v5/data/edoc2:/app/wwwroot/external
      - /opt/edoc2/ZHF/edoc2v5/data/edoc2Docs:/edoc2Docs
      - /opt/MJBZGL:/opt/MJBZGL
      - /usr/local/lib/libslinterface.so:/usr/local/lib/libslinterface.so
      #- /opt/01:/opt/01
    env_file:
      ./envfile.env
    #environment:
    #  - ZF_UNAME=cjj
    #  - ZF_AUTHCODE=DVQFPLSSH4AQDPM72M5WBUQMYDMR46UK
    #  - ZF_AUTHFILE=/opt/01
    #  - ZF_PINGCODE=
    networks:
      - edoc2
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      endpoint_mode: dnsrr
      restart_policy:
        condition: on-failure
  wf:
    image: 192.168.251.78/edoc2v5/wf:20200801145841
    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"
  orgsync:
    hostname: orgsync
    image: 192.168.251.78/edoc2v5/orgsync:20200801145818
    labels:
      "type": "1"
    networks:
      - edoc2
    environment:
      - ISTITLE=0
    env_file:
      ./envfile.env
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
  nginx: 
    hostname: nginx
    image: 192.168.251.78/edoc2v5/nginx:v512-0515
    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:
#      - /opt/edoc2/ZHF/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"

networks:
  edoc2:
    external: true
    name: ZHF


