version: '3'
services:
  {{search_server_name}}:
{% if (ansible_become == true and ansible_become_user == 'root') or ansible_user == 'root' %}
    user: {{uid}}:{{gid}}
{% else %}
    user: root:0
{% endif %}
    image: ghcr.io/freva-org/freva-solr:{{solr_version}}
    hostname: {{search_server_name}}
    environment:
      - API_SOLR_PORT=8983
      - API_SOLR_HEAP={{search_server_solr_mem}}
    ports:
      - 8983:8983
    volumes:
      - data:/data/db:z
      - logs:/data/logs:z
    container_name: {{ search_server_name }}
    tty: true

volumes:
    data:
    logs:
