This document provides instructions for building and running the Karaoke For Jellyfin application using Docker.
-
Copy the environment file:
cp .env.local.example .env.local
-
Edit
.env.localwith your configuration:# Jellyfin Configuration JELLYFIN_SERVER_URL=http://host.docker.internal:8096 JELLYFIN_API_KEY=your_jellyfin_api_key_here JELLYFIN_USERNAME=your_jellyfin_username_here # Lyrics Configuration (adjust paths as needed) LYRICS_PATH=./lyrics JELLYFIN_MEDIA_PATH=/path/to/your/jellyfin/media
-
Start the application:
docker-compose up -d
-
Access the application:
- Mobile interface: http://localhost:3000
- TV display: http://localhost:3000/tv
-
Build the image:
docker build -t karaoke-for-jellyfin . -
Run the container:
docker run -d \ --name karaoke-app \ -p 3000:3000 \ -e JELLYFIN_SERVER_URL=http://host.docker.internal:8096 \ -e JELLYFIN_API_KEY=your_api_key \ -e JELLYFIN_USERNAME=your_username \ -v $(pwd)/lyrics:/app/lyrics:ro \ -v /path/to/jellyfin/media:/app/media:ro \ --add-host host.docker.internal:host-gateway \ karaoke-for-jellyfin
| Variable | Description | Default | Required |
|---|---|---|---|
JELLYFIN_SERVER_URL |
URL to your Jellyfin server | http://localhost:8096 |
Yes |
JELLYFIN_API_KEY |
Jellyfin API key | - | Yes |
JELLYFIN_USERNAME |
Jellyfin username | - | Yes |
LYRICS_PATH |
Path to lyrics folder | /app/lyrics |
No |
JELLYFIN_MEDIA_PATH |
Path to Jellyfin media | /app/media |
No |
| Variable | Description | Default | Required |
|---|---|---|---|
RATING_ANIMATION_DURATION |
Rating screen display duration | 15000 |
No |
NEXT_SONG_DURATION |
Next song splash screen duration | 15000 |
No |
CONTROLS_AUTO_HIDE_DELAY |
Auto-hide TV controls after inactivity | 10000 |
No |
AUTOPLAY_DELAY |
Initial autoplay delay | 500 |
No |
QUEUE_AUTOPLAY_DELAY |
Queue autoplay delay | 1000 |
No |
TIME_UPDATE_INTERVAL |
Time update sync interval | 2000 |
No |
Fast-Paced Party Setup:
RATING_ANIMATION_DURATION=8000 # 8 seconds
NEXT_SONG_DURATION=5000 # 5 seconds
CONTROLS_AUTO_HIDE_DELAY=5000 # 5 secondsRelaxed Home Setup:
RATING_ANIMATION_DURATION=20000 # 20 seconds
NEXT_SONG_DURATION=10000 # 10 seconds
CONTROLS_AUTO_HIDE_DELAY=15000 # 15 secondsCommercial Venue Setup:
RATING_ANIMATION_DURATION=12000 # 12 seconds
NEXT_SONG_DURATION=8000 # 8 seconds
TIME_UPDATE_INTERVAL=1000 # 1 second (tighter sync)- Lyrics Directory: Mount your lyrics folder to
/app/lyrics(read-only) - Media Directory: Mount your Jellyfin media folder to
/app/media(read-only)
The application needs to communicate with your Jellyfin server. There are several ways to configure this:
Use host.docker.internal in your Jellyfin URL and add the host gateway:
--add-host host.docker.internal:host-gatewayUse host networking to access services on localhost:
network_mode: hostIf Jellyfin is running in another container, use a shared network.
For development, you can mount the source code and use hot reloading:
docker run -it \
--name karaoke-dev \
-p 3000:3000 \
-v $(pwd):/app \
-v /app/node_modules \
-e NODE_ENV=development \
node:18-alpine \
sh -c "cd /app && npm install && npm run dev"To build for multiple architectures (useful for deployment on different systems):
# Build for AMD64 and ARM64
docker buildx build --platform linux/amd64,linux/arm64 -t karaoke-for-jellyfin .-
Cannot connect to Jellyfin server
- Ensure
JELLYFIN_SERVER_URLis accessible from within the container - Use
host.docker.internalinstead oflocalhostif Jellyfin is on the host - Check firewall settings
- Ensure
-
Lyrics not loading
- Verify the lyrics directory is mounted correctly
- Check file permissions (container runs as user
nextjswith UID 1001)
-
WebSocket connection issues
- Ensure port 3000 is properly exposed
- Check if reverse proxy is configured correctly for WebSocket upgrades
-
Permission denied errors
- The container runs as a non-root user (nextjs:nodejs)
- Ensure mounted volumes have appropriate permissions
View application logs:
# Docker Compose
docker-compose logs -f karaoke-app
# Docker directly
docker logs -f karaoke-appCheck if the application is running:
curl http://localhost:3000/api/health- Secure API keys: Store Jellyfin API keys securely (consider using Docker secrets)
- Network security: Use proper firewall rules and consider using a reverse proxy
- Regular updates: Keep the Docker image updated with security patches
- Resource limits: Set appropriate CPU and memory limits
- Persistent storage: Use named volumes for better performance
- Reverse proxy: Use nginx or similar for SSL termination and caching
version: "3.8"
services:
karaoke-app:
build: .
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000" # Only bind to localhost
environment:
- NODE_ENV=production
- JELLYFIN_SERVER_URL=https://your-jellyfin-server.com
- JELLYFIN_API_KEY_FILE=/run/secrets/jellyfin_api_key
volumes:
- lyrics_data:/app/lyrics:ro
- media_data:/app/media:ro
secrets:
- jellyfin_api_key
deploy:
resources:
limits:
memory: 512M
cpus: "0.5"
volumes:
lyrics_data:
external: true
media_data:
external: true
secrets:
jellyfin_api_key:
external: trueIf you encounter issues with the Docker setup, please check:
- Docker and Docker Compose versions
- System requirements and available resources
- Network connectivity to Jellyfin server
- File permissions for mounted volumes