Skip to content

Commit

Permalink
fix database error on restart
Browse files Browse the repository at this point in the history
  • Loading branch information
GiuseppeGalilei committed May 9, 2024
1 parent 14ed535 commit 71edb83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion OneLiner/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
protocol: tcp
restart: unless-stopped
volumes:
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js
- ${INSTALL_FOLDER}/unifi/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js
- type: bind
source: ${INSTALL_FOLDER}/unifi/unifi-db
target: /data/db
Expand Down
2 changes: 1 addition & 1 deletion OneLiner/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ echo "INSTALL_FOLDER=$path" > .env
echo "DB_PASSWORD=$password" >> .env

#generate init-mongo.js file
cat <<EOL > init-mongo.js
cat <<EOL > $path/unifi/init-mongo.js
db.getSiblingDB("unifi-db").createUser({user: "unifi", pwd: "$password", roles: [{role: "dbOwner", db: "unifi-db"}]});
db.getSiblingDB("unifi-db_stat").createUser({user: "unifi", pwd: "$password", roles: [{role: "dbOwner", db: "unifi-db_stat"}]});
EOL
Expand Down

0 comments on commit 71edb83

Please sign in to comment.