Kapacitor docker container doesn't working. Permission denied on write to /var/log

I try to use docker kapacitor container as a part of openjti infrastructure.
Kapacitor seemed pretty standart.
Compose file contains:

    image: kapacitor:1.7
    container_name: kapacitor
    restart: always
    user: root
      - influxdb
      - '9092:9092'
      - /var/log:/var/log
      - ./kapacitor/kapacitor.conf:/etc/kapacitor/kapacitor.conf
      - ./kapacitor/data:/var/lib/kapacitor

But it doesn’t start with error:

2024/06/10 14:54:11 Using configuration at: /etc/kapacitor/kapacitor.conf
ts=2024-06-10T14:54:11.427Z lvl=error msg="encountered error" service=run err="failed to open diagnostic service: mkdir /var/log/kapacitor: permission denied"
run: failed to open diagnostic service: mkdir /var/log/kapacitor: permission denied

Can someone please point me to right direction how I need to config my permissions.
AFAIK all should work as normal because container started as root.

@Tormato Welcome to the community! Does the container shut down when it encounters this error or are you still able to exec into it? I’m wondering if kapactord inside the container is running under a different non-root user.

FYI Kapacitor no longer runs as root and runs as the kapacitor user:

Starting in v1.7.4, Kapacitor no longer run as the root user by default. If a user wants to revert this change they can set KAPACITOR_AS_ROOT=true as an environment variable.