3

I have CouchDB v2.3 running using the official Docker image. I've configured the database as a Single Node using Fauxton.

The /data directory is mount to a local directory. When I'm restarting the container, the databases are still there. So the volume binding works as expected.

Now, everytime I'm restarting the container and I navigate to the 'Setup' tab, it looks like CouchDB did not remember I've configured it as a Single Node.

I keep seeing the following screen after restarting the image enter image description here

Once I've configured it again, I see the following screen

enter image description here

Until I reboot the container. Then I have to the first screen again.

What is going on here?

5
  • Refer stackoverflow.com/a/54523511/2031560 Commented Feb 21, 2019 at 11:28
  • I'm not sure if I get that. The volume is re-mounted, as the databases are still available after restarting the Docker container. Commented Feb 21, 2019 at 11:45
  • I have this issue as well. Persistance of the dockers /opt/couchdb/data works without issue, and data is retained, but somehow admin users and actual couchDB setup is not. I.e. probably stored somewhere else.. Commented Jan 7, 2020 at 18:49
  • I'm quite sure that the heading named "Using a persistent CouchDB configuration file" on the dockerhub page for couchdb solves this. Now for why your copied file did not, I have no clue. Commented Jan 7, 2020 at 19:01
  • Similar issue here with couchdb v3. No solution for me yet :( github.com/apache/couchdb/issues/3257 Commented Nov 10, 2020 at 13:53

1 Answer 1

1

I was using the wrong CouchDB configuration file path to apply my own configuration.

Non-working example (Dockerfile)

FROM couchdb:2.3
COPY local.ini /opt/couchdb/etc/local.d/docker.ini

Working example (Dockerfile)

FROM couchdb:2.3.0
COPY local.ini /opt/couchdb/etc/local.ini

local.ini

To make sure the cluster should not be re-configured when the Docker container is being re-started, I've also put the configuration inside the local.ini file.

; CouchDB Configuration Settings

; Custom settings should be made in this file. They will override settings
; in default.ini, but unlike changes made to default.ini, this file won't be
; overwritten on server upgrade.

[chttpd]
port = 5984
bind_address = 0.0.0.0

; To create an admin account uncomment the '[admins]' section below and add a
; line in the format 'username = password'. When you next start CouchDB, it
; will change the password to a hash (so that your passwords don't linger
; around in plain-text files). You can add more admin accounts with more
; 'username = password' lines. Don't forget to restart CouchDB after
; changing this.
[admins]
admin = ******

[cluster]
n = 1

I'm not yet sure why my initial configuration copied to /opt/couchdb/etc/local.d/docker.ini wasn't working before.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.