version: '3.5'

services:
### SVC:apm:>>>
  apm:
    hostname: apm
    image: registry.edoc2.com:5000/edoc2v5/apm:edrms-v6.5.0.3
    networks:
      - macrowing
    ports:
      - "8083:80"
    volumes:
      - /var/run/docker.sock:/app/docker.sock
      - /home/edoc2/macrowing/edoc2v5/data/sqlite:/app/sqlite
      - /var/log/:/hostfs/var/log/
      - /tmp:/usr/share/filebeat/data
    env_file:
      ./envfile.env
    environment:
      #- ECM_ESURL=http://192.168.251.125:30003
      - MiddlewareIsCluster=0
      - FilterContainer=inwise
      - SwarmOrKube=Swarm
      - NeedLogService=edoc2,transport,content,perm,decryption,inbiz,auth,initdatabase,org
      #- LOGGER_ISDEBUG=true
#      - DatabaseType=1
#      - DatabaseServerName=sqlserver
#      - DatabaseServerPort=1433
#      - DatabaseUserName=sa
#      - DatabasePassword=1qaz2WSX
#    extra_hosts:
#        - "redis1:192.168.20.76"
#        - "redis2:192.168.20.77"
#        - "redis3:192.168.20.78"
    deploy:
      placement:
        constraints:
          - node.labels.isapm == true
      replicas: 1
      restart_policy:
        condition: on-failure
      resources:
        limits:
          cpus: '2'
          memory: 4G
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:apm:<<<
### SVC:basic:>>>
  basic:
    image: registry.edoc2.com:5000/edoc2v5/metricbasic:edrms-v6.5.0.3
    user: root
    volumes:
      - type: bind
        source: /proc
        target: /hostfs/proc
        read_only: true
      - type: bind
        source: /sys/fs/cgroup
        target: /hostfs/sys/fs/cgroup
        read_only: true
      - type: bind
        source: /
        target: /hostfs
        read_only: true
      - type: bind
        source: /var/run/docker.sock
        target: /var/run/docker.sock
        read_only: true
    #environment:
      # 使用内置的ecm es，ELASTICSEARCH_HOSTS 不要配置
      #- ELASTICSEARCH_HOSTS=http://192.168.251.125:30003
    deploy:
      mode: global
      restart_policy:
        condition: on-failure
      #resources:
      #  limits:
      #    cpus: '1'
      #    memory: 256M
    networks:
      - hostnet
    logging:
      driver: "json-file"
      options:
        max-size: "2000k"
        max-file: "10"
### SVC:basic:<<<

networks:
  hostnet:
    external: true
    name: host
  macrowing:
    external: true
    name: macrowing
