version: '3'
services:
  solr:
    image: solr:8.11
    container_name: solr
    hostname: solr      
    restart: unless-stopped
    networks:
      - develop  
    volumes: 
      - solr-data:/var/solr/
      - ./solr.xml:/var/solr/solr.xml
      - ./zoo.cfg:/var/solr/zoo.cfg
    ports:
      - "127.0.0.1:8191:8191"       
    environment:
      ZK_HOST: zk:2181
      ZK_CLIENT_TIMEOUT: 15000
      SOLR_PORT: "8191"
      SOLR_HEAP: "1024m"
      SOLR_HOST: solr        
    logging:
      driver: json-file
      options:
        max-size: 100m
        max-file: "1"        

  zk:
    image: zookeeper:3.6
    container_name: zk
    restart: unless-stopped
    volumes:
      - zk-data:/data
    networks:
      - develop   
    environment:
      ZOO_MY_ID: 1
      ZOO_AUTOPURGE_PURGEINTERVAL: 1
      ZOO_AUTOPURGE_SNAPRETAINCOUNT: 3
    logging:
      driver: json-file
      options:
        max-size: 100m
        max-file: "1"

volumes:
  solr-data:
    external:
      name: solr-data
  zk-data:
    external:
      name: zk-data

networks:
  develop:
    external:
      name: develop          
