Docker-compose container loses index path settings

I have this docker-compose file

  image: couchbase:community-6.5.0
  container_name: couchbase-node-01
    - /var/docker/couchbase/data:/data:z
    - /var/docker/couchbase/index:/index:z
    - /var/docker/couchbase/settings:/opt/couchbase/var:z
    - 8091:8091

After run “docker-compose up -d” I setup new cluster with this settings

So in the web console there is this

Annotazione 2020-05-12 102528

after this, I do “docker-compose down” and it destroys the container, and after I run again “docker-compose up -d”. And now, when I go to web console, there is this

where Couchbase saves the path of data and index?

That information is stored in the container in /opt/couchbase/etc/couchdb/local.ini, unfortunately. You can add that path as an additional bind point in your docker-compose file, eg.

- /var/docker/couchbase/couchdb-local.ini:/opt/couchbase/etc/couchdb/local.ini

For this to work, you must ensure that the local file (/var/docker/couchbase/couchdb-local.ini in my example) exists and is writable by UID 1000 before bringing the service up.

You can’t just mount the entire /opt/couchbase/etc/couchdb directory because there are other files in there which Server expects to exist when it first starts; it won’t start if that directory is empty. It appears that it’s OK if that one specific file etc/couchdb/local.ini is an empty file when first starting, however.