Add Docker support with Dockerfile, docker-compose, and deployment documentation
This commit is contained in:
19
docker-entrypoint.sh
Executable file
19
docker-entrypoint.sh
Executable 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
|
||||
Reference in New Issue
Block a user