diff --git a/configs/0_local.ini b/configs/0_local.ini deleted file mode 100644 index c9cc7e4..0000000 --- a/configs/0_local.ini +++ /dev/null @@ -1,6 +0,0 @@ -; CouchDB configuration file, named to have a lower priority than ./docker.ini -; See https://docs.couchdb.org/en/stable/config/index.html - -[fabric] -; Prevent "No DB shards could be opened" errors, see https://github.com/apache/couchdb/issues/4497 -shard_timeout_min_msec = 5000 diff --git a/couchdb/Dockerfile.couchdb b/couchdb/Dockerfile.couchdb index ad7666e..bfb5c62 100644 --- a/couchdb/Dockerfile.couchdb +++ b/couchdb/Dockerfile.couchdb @@ -1,14 +1,5 @@ FROM couchdb:3.4.2 -COPY docker-custom-entrypoint.sh /usr/local/bin/docker-custom-entrypoint.sh -COPY init_users_db.sh /usr/local/bin/init_users_db.sh +COPY local.ini /opt/couchdb/etc/local.d/local.ini -ENTRYPOINT ["tini", "--", "/usr/local/bin/docker-custom-entrypoint.sh"] - -EXPOSE 5984 - -# Copied from the couchdb image Dockerfile -# https://github.com/apache/couchdb-docker/blob/734c61f/3.4.2/Dockerfile#L104 -# as it would have been otherwise reset to an empty string -# See https://docs.docker.com/reference/dockerfile/#understand-how-cmd-and-entrypoint-interact -CMD ["/opt/couchdb/bin/couchdb"] +# Inherit ENTRYPOINT and CMD from couchdb image diff --git a/couchdb/docker-custom-entrypoint.sh b/couchdb/docker-custom-entrypoint.sh deleted file mode 100755 index d0dd298..0000000 --- a/couchdb/docker-custom-entrypoint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -/usr/local/bin/init_users_db.sh & -tini -- /docker-entrypoint.sh "$@" \ No newline at end of file diff --git a/couchdb/init_users_db.sh b/couchdb/init_users_db.sh deleted file mode 100755 index 254300e..0000000 --- a/couchdb/init_users_db.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -while :; do { - echo "[init_users_db.sh] Waiting for CouchDB to be online to initialize the _users database" - curl http://localhost:5984 && { - echo "[init_users_db.sh] CouchDB is online! Trying to initialize _users database" - curl --user "$COUCHDB_USER:$COUCHDB_PASSWORD" -XPUT http://localhost:5984/_users - break - } || { - sleep 1 - } -}; done diff --git a/couchdb/local.ini b/couchdb/local.ini new file mode 100644 index 0000000..92f6b96 --- /dev/null +++ b/couchdb/local.ini @@ -0,0 +1,8 @@ +[couchdb] +; Automatically create the system databases on startup (in particular `_users`) +; see https://docs.couchdb.org/en/stable/config/couchdb.html#couchdb/single_node +single_node = true + +[fabric] +; Prevent "No DB shards could be opened" errors, see https://github.com/apache/couchdb/issues/4497 +shard_timeout_min_msec = 5000 diff --git a/docker-compose.yml b/docker-compose.yml index c2b7484..e7882b4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,7 +22,6 @@ services: # - "5984:5984" volumes: - 'couchdb:/opt/couchdb/data' - - './configs:/opt/couchdb/etc/local.d' tty: true restart: unless-stopped elasticsearch: