version: '3'
services:
  {{mongo_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-mongo:{{ mongodb_server_version }}
    hostname: {{mongo_name}}
    environment:
      - API_MONGO_PASSWORD={{mongodb_server_db_passwd}}
      - API_MONGO_DB=search_stats
      - API_MONGO_USER={{mongodb_server_db_user}}
    ports:
      - 27017:27017
    volumes:
      - data:/data/db:z
      - logs:/data/logs:z
    container_name: {{ mongo_name }}
    tty: true

volumes:
    data:
    logs:
