I can't persist the data in the container

Hi, I have started influxdb v2 on my server with docker, but I have configured the option to persist the data, but when I delete the container, the data is not persisted in my local folder.
this is my docker-compose
image

Hello @Miguel1,
Hmm I’m not sure. @Jay_Clifford have you ever experienced this?

Hi @Miguel1
First of all, I would upgrade to version 2.4. We did quite a bit of optimization and structural changes since then. If I remember rightly on the initial versions of the 2.0 docker container the file pathing was different. Try this example out:

  influxdb:
    image: influxdb:latest 
    volumes:
      # Mount for influxdb data directory and configuration
      - ./influxdb/data:/var/lib/influxdb2:rw
    ports:
      - 8086:8086
    environment:
      - DOCKER_INFLUXDB_INIT_MODE=setup 
      - DOCKER_INFLUXDB_INIT_USERNAME=demouser
      - DOCKER_INFLUXDB_INIT_PASSWORD=demouser
      - DOCKER_INFLUXDB_INIT_ORG=influxroadshow 
      - DOCKER_INFLUXDB_INIT_BUCKET=generators
      - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=edge