Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup Apache CouchDB screen re-appears on container restart

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?

like image 494
ndequeker Avatar asked Mar 09 '26 17:03

ndequeker


1 Answers

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.

like image 164
ndequeker Avatar answered Mar 11 '26 13:03

ndequeker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!