Files
docker-inventaire/couchdb/init_users_db.sh
maxlath 69db3e1a86 docker-compose.yml: use a pre-build inventaire image and env_file=.env
and customize CouchDB entrypoint script to fix the issue of the missing _users database
2025-02-28 11:42:48 +01:00

13 lines
371 B
Bash
Executable File

#!/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