Sign inSign up

mrrobotogit/discoverylastfm

By mrrobotogit

•Updated 7 months ago

Automated music discovery integration for Last.fm and music management systems (Lidarr/Headphones)

Image
0

6.6K

mrrobotogit/discoverylastfm repository overview

⁠DiscoveryLastFM Docker 🐳

Docker Pulls Docker Image Size

Streamlined Docker container for DiscoveryLastFM v2.1.0 - automated music discovery that integrates Last.fm with music management systems (Lidarr/Headphones).

šŸŽ‰ v2.1.0 with Auto-Update System! GitHub releases monitoring, CLI commands, and simplified Docker setup.

ā šŸš€ Quick Start

# Download all required files
curl -L -O https://raw.githubusercontent.com/MrRobotoGit/DiscoveryLastFM-Docker/main/docker-compose.yml
curl -L -O https://raw.githubusercontent.com/MrRobotoGit/DiscoveryLastFM-Docker/main/.env.example
curl -L -O https://raw.githubusercontent.com/MrRobotoGit/DiscoveryLastFM-Docker/main/Dockerfile

# Configure environment (REQUIRED variables already have dummy values)
cp .env.example .env
nano .env  # Replace dummy values with your real credentials

# āš ļø IMPORTANT: These variables are REQUIRED for container startup:
# AUTO_UPDATE_ENABLED=true
# UPDATE_CHECK_INTERVAL_HOURS=24

# Start the stack (first run builds image with bash included)
docker compose up -d
⁠Docker Run
# First, download Dockerfile and build the image
curl -L -O https://raw.githubusercontent.com/MrRobotoGit/DiscoveryLastFM-Docker/main/Dockerfile
docker build -t discoverylastfm-local .

# With Lidarr
docker run -d \
  --name discoverylastfm \
  -e LASTFM_USERNAME=your_username \
  -e LASTFM_API_KEY=your_api_key \
  -e MUSIC_SERVICE=lidarr \
  -e LIDARR_API_KEY=your_lidarr_key \
  -e LIDARR_ENDPOINT=http://your-lidarr:8686 \
  -e AUTO_UPDATE_ENABLED=true \
  -e UPDATE_CHECK_INTERVAL_HOURS=24 \
  -v discoverylastfm_config:/app/config \
  -v discoverylastfm_logs:/app/logs \
  discoverylastfm-local:latest

# With Headphones  
docker run -d \
  --name discoverylastfm \
  -e LASTFM_USERNAME=your_username \
  -e LASTFM_API_KEY=your_api_key \
  -e MUSIC_SERVICE=headphones \
  -e HP_API_KEY=your_headphones_key \
  -e HP_ENDPOINT=http://your-headphones:8181 \
  -e AUTO_UPDATE_ENABLED=true \
  -e UPDATE_CHECK_INTERVAL_HOURS=24 \
  -v discoverylastfm_config:/app/config \
  -v discoverylastfm_logs:/app/logs \
  discoverylastfm-local:latest

⁠✨ What's Included

  • šŸŽµ DiscoveryLastFM v2.1.0: Main application with auto-update system
  • šŸš€ Auto-Update: GitHub releases monitoring with backup and rollback
  • ⚔ Redis Cache: Performance optimization with caching layer
  • šŸ“± Multi-Architecture: AMD64 and ARM64 (Raspberry Pi) support
  • šŸ”§ Simple Configuration: Environment-based setup
  • šŸ“Š Health Monitoring: Built-in health checks
  • šŸ”’ Security: Non-root user, minimal attack surface

ā šŸ“– Required Configuration

āš ļø CRITICAL: These variables are REQUIRED for the container to start. Missing values will cause startup failure.

VariableRequiredDefaultDescription
LASTFM_USERNAMEYESdummy_usernameYour Last.fm username
LASTFM_API_KEYYESdummy_api_key_replace_with_real_oneLast.fm API key (Get here⁠)
AUTO_UPDATE_ENABLEDYEStrueEnable auto-update checking
UPDATE_CHECK_INTERVAL_HOURSYES24Update check interval
MUSIC_SERVICEYESlidarrMusic service (lidarr or headphones)

🚨 Startup Error: Without these required variables, container fails with:

/usr/local/bin/docker-entrypoint.sh: line 270: syntax error near unexpected token 'else'
⁠Lidarr Configuration (if MUSIC_SERVICE=lidarr)
VariableRequiredDefaultDescription
LIDARR_API_KEYYESdummy_lidarr_api_key_replace_with_real_oneLidarr API key
LIDARR_ENDPOINTNOhttp://lidarr:8686Lidarr server URL
LIDARR_ROOT_FOLDERNO/musicMusic library path
⁠Headphones Configuration
VariableDescriptionDefault
HP_API_KEYHeadphones API keyRequired
HP_ENDPOINTHeadphones server URLhttp://headphones:8181

ā šŸŽÆ Operation Modes

ModeDescriptionUsage
syncOne-time discovery run-e DISCOVERY_MODE=sync
cronScheduled runs (default)-e CRON_SCHEDULE="0 3 * * *"
daemonContinuous background-e SLEEP_HOURS=6
testValidation mode-e DRY_RUN=true
⁠v2.1.0 Auto-Update Configuration āš ļø REQUIRED
VariableRequiredDefaultDescription
AUTO_UPDATE_ENABLEDYEStrueEnable auto-update checking
UPDATE_CHECK_INTERVAL_HOURSYES24Check interval in hours
BACKUP_RETENTION_DAYSNO7Backup retention in days
ALLOW_PRERELEASE_UPDATESNOfalseInclude pre-releases
GITHUB_TOKENNO``GitHub API token (optional)

ā šŸ”§ Management

⁠View Logs
docker logs -f discoverylastfm
⁠Health Check
docker exec discoverylastfm /usr/local/bin/health-check
⁠Update Image
docker pull mrrobotogit/discoverylastfm:latest
docker compose up -d  # Restart with new image
⁠v2.1.0 CLI Commands
# Check for updates
docker compose exec discoverylastfm python DiscoveryLastFM.py --update-status

# Install updates
docker compose exec discoverylastfm python DiscoveryLastFM.py --update

# List backups
docker compose exec discoverylastfm python DiscoveryLastFM.py --list-backups

# Check version
docker compose exec discoverylastfm python DiscoveryLastFM.py --version

# Clean temporary files
docker compose exec discoverylastfm python DiscoveryLastFM.py --cleanup

ā šŸ·ļø Available Tags

TagDescriptionArchitecture
latestLatest stable release (v2.1.0)amd64, arm64
v2.1.0Current stable versionamd64, arm64
mainDevelopment buildsamd64, arm64

⁠🚨 Common Issues

⁠Container Won't Start (bash compatibility error)

If you see /usr/local/bin/docker-entrypoint.sh: line 270: syntax error near unexpected token 'else':

# The error occurs because the official v2.1.0 image doesn't include bash
# Solution: Build the image using our Dockerfile which includes bash

# Download Dockerfile and build
curl -L -O https://raw.githubusercontent.com/MrRobotoGit/DiscoveryLastFM-Docker/main/Dockerfile
docker build -t discoverylastfm-local .

# Use discoverylastfm-local:latest instead of mrrobotogit/discoverylastfm:latest
⁠Container Won't Start (General)
# Check logs
docker logs discoverylastfm

# Validate configuration
docker exec discoverylastfm /usr/local/bin/health-check config
⁠macOS/Windows Permission Issues

Problem: chmod: Operation not permitted or endless restarts

Solutions:

# Use PUID/PGID environment variables
docker run -e PUID=1000 -e PGID=1000 ... mrrobotogit/discoverylastfm

# Or use bind mounts with local directories
mkdir -p ./data/{config,logs,cache}
docker run -v ./data/config:/app/config ... mrrobotogit/discoverylastfm
⁠Service Connection Issues
# Test Last.fm connectivity
docker exec discoverylastfm curl -f "http://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=${LASTFM_USERNAME}&api_key=${LASTFM_API_KEY}&format=json"

# Test Lidarr connectivity  
docker exec discoverylastfm curl -f -H "X-Api-Key: ${LIDARR_API_KEY}" "${LIDARR_ENDPOINT}/api/v1/system/status"

⁠🌐 Architecture

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   Last.fm API   │────│ DiscoveryLastFM │────│ Lidarr/Headphones │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    │    + Redis      │    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                       ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

ā šŸ“„ License

MIT License - see LICENSE⁠ for details.


Maintainer: Matteo Rancilio (MrRobotoGit)
🌟 Star this repo if you find it useful!

Tag summary

Content type

Image

Digest

sha256:8ef91c18f…

Size

63.4 MB

Last updated

7 months ago

docker pull mrrobotogit/discoverylastfm