version: '3'
services:
  {{cache_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-redis:{{redis_version}}
    hostname: {{cache_name}}
    container_name: {{cache_name}}
    tty: true
    ports:
      - "6379:6379"
    volumes:
        - data:/data/db:z
        - logs:/data/logs:z
        - {{data_dir}}/config:/data/config:z

volumes:
  data:
  logs:
