fix(entrypoint): wait for DB file before bind mounting
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 4m0s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 4m0s
This commit is contained in:
@@ -99,8 +99,21 @@ start_app() {
|
||||
# Ensure shared directories exist
|
||||
mkdir -p /shared_data/plugins /shared_data/cache /shared_data/backup /shared_data/artist_images
|
||||
|
||||
# Wait for LiteFS to expose the DB file in the FUSE mount
|
||||
echo "Waiting for /data/navidrome.db..."
|
||||
local db_timeout=30
|
||||
local db_count=0
|
||||
while [ ! -f /data/navidrome.db ] && [ $db_count -lt $db_timeout ]; do
|
||||
sleep 1
|
||||
db_count=$((db_count + 1))
|
||||
done
|
||||
|
||||
if [ ! -f /data/navidrome.db ]; then
|
||||
echo "ERROR: /data/navidrome.db did not appear after ${db_timeout}s"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Bind mount the DB so Navidrome finds it in its DataFolder
|
||||
# We use bind mount because /shared_data is likely SMB and doesn't support symlinks
|
||||
touch /shared_data/navidrome.db
|
||||
mount --bind /data/navidrome.db /shared_data/navidrome.db
|
||||
|
||||
|
||||
Reference in New Issue
Block a user