version: '3.5'

services:
  redis:
    hostname: redis
    image: registry.edoc2.com:5000/edoc2v5/redis:v6.0.14-alpine-20210628
    labels:
      "type": "2"
    networks: 
      - edoc2
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure


  rabbitmq:
    hostname: rabbitmq
    image: registry.edoc2.com:5000/edoc2v5/rabbitmq:v3.8.17-alpine-20211113
    volumes:
      - rabbitmq:/var/lib/rabbitmq
    labels:
      "type": "2"
    networks: 
      - edoc2
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure

  es:
    image: registry.edoc2.com:5000/edoc2v5/elasticsearch-huawei:v6.7.1.2-20210603
    hostname: es
    labels:
      "type": "2"
    networks: 
      - edoc2
    environment:
      - node.name=es
      - ES_JAVA_OPTS=-Xmx2g -Xms2g
    deploy:
      placement:
        constraints:
          - node.labels.nodetype == InDrive
      replicas: 1
      restart_policy:
        condition: on-failure

networks:
  middleware:
    external: true
    name: macrowing
