Add Docker support with Dockerfile, docker-compose, and deployment documentation

This commit is contained in:
2025-12-07 23:47:07 +00:00
parent 4f954d9b15
commit 2ca35620d9
5 changed files with 244 additions and 0 deletions

19
docker-entrypoint.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
set -e
# Create config if it doesn't exist
if [ ! -f /app/config.json ]; then
echo '{"libraryPath":"/data/music","port":4000}' > /app/config.json
fi
# Run database initialization
node -e "import('./src/database/db.js').then(m => m.initDatabase())"
# Check if we need to scan the library
if [ ! -f /app/audio_server.db ] || [ "$SCAN_ON_START" = "true" ]; then
echo "Scanning music library..."
node src/scripts/scanLibrary.js /data/music || true
fi
# Start the server
exec npm start