A Go rewrite of PlexCommender - a music discovery backend that integrates Plex, external music APIs, and LLMs to recommend new artists based on listening habits.
- Plex Integration: Extract high-rated tracks and known artists from Plex library
- LLM Recommendations: Use OpenAI to suggest new artists based on listening patterns
- Multi-Source Verification: Verify and enrich artist data from MusicBrainz, Discogs, and Last.fm
- Intelligent Caching: SQLite-based caching with TTL and background refresh
- REST API: HTTP API ready for web UI integration
-
Pull and run the latest container:
# Pull from GitHub Container Registry docker pull ghcr.io/your-username/gocommender:latest # Run with environment file docker run -d \ --name gocommender \ -p 8080:8080 \ --env-file .env \ -v ./data:/app/data:Z \ ghcr.io/your-username/gocommender:latest
-
Or use Docker Compose:
# Copy environment template cp .env.example .env # Edit .env with your API keys and Plex configuration # Deploy with Docker Compose docker-compose up -d
-
Copy environment configuration:
cp .env.example .env # Edit .env with your API keys and Plex configuration -
Build and run:
task build ./build/gocommender
- Go 1.24.5+
- Task for build automation
- Docker (for containerized deployment)
task build- Build the servertask build-versioned- Build with version informationtask test- Run teststask test-ci- Run tests with coveragetask lint- Run linter and formattertask dev- Run development servertask clean- Clean build artifacts
cmd/server/ - HTTP server entry point
internal/api/ - HTTP handlers and routing
internal/config/ - Configuration management
internal/models/ - Data structures
internal/services/ - Business logic
POST /api/recommend- Get artist recommendationsGET /api/health- Health checkGET /api/info- Detailed API and build informationGET /api/artists/{mbid}- Get cached artist detailsGET /api/plex/playlists- List Plex playlistsGET /api/cache/stats- Cache performance statistics
- Multi-architecture support: linux/amd64, linux/arm64
- Non-root user: Runs as user ID 1001 for security
- Health checks: Built-in health check endpoint at
/api/health - Optimized size: Multi-stage build for minimal image size
- Security scanning: Automated vulnerability scanning in CI/CD
- Version information: Built-in version and build info via
/api/info
# Basic run with required environment variables
docker run -d \
--name gocommender \
-p 8080:8080 \
-e PLEX_URL=http://your-plex-server:32400 \
-e PLEX_TOKEN=your_plex_token \
-e OPENAI_API_KEY=your_openai_key \
-v ./data:/app/data:Z \
ghcr.io/your-username/gocommender:latest
# With all optional APIs
docker run -d \
--name gocommender \
-p 8080:8080 \
-e PLEX_URL=http://your-plex-server:32400 \
-e PLEX_TOKEN=your_plex_token \
-e OPENAI_API_KEY=your_openai_key \
-e DISCOGS_TOKEN=your_discogs_token \
-e LASTFM_API_KEY=your_lastfm_key \
-v ./data:/app/data:Z \
ghcr.io/your-username/gocommender:latestversion: "3.8"
services:
gocommender:
image: ghcr.io/your-username/gocommender:latest
ports:
- "8080:8080"
environment:
- PLEX_URL=${PLEX_URL}
- PLEX_TOKEN=${PLEX_TOKEN}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- DISCOGS_TOKEN=${DISCOGS_TOKEN}
- LASTFM_API_KEY=${LASTFM_API_KEY}
- DATABASE_PATH=/data/gocommender.db
volumes:
- gocommender-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
interval: 30s
timeout: 10s
retries: 3
# Note: Using bind mount ./data:/app/data:Z instead of named volumeapiVersion: apps/v1
kind: Deployment
metadata:
name: gocommender
spec:
replicas: 1
selector:
matchLabels:
app: gocommender
template:
metadata:
labels:
app: gocommender
spec:
containers:
- name: gocommender
image: ghcr.io/your-username/gocommender:latest
ports:
- containerPort: 8080
env:
- name: PLEX_URL
valueFrom:
secretKeyRef:
name: gocommender-secrets
key: plex-url
- name: PLEX_TOKEN
valueFrom:
secretKeyRef:
name: gocommender-secrets
key: plex-token
- name: OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: gocommender-secrets
key: openai-key
volumeMounts:
- name: data
mountPath: /data
livenessProbe:
httpGet:
path: /api/health
port: 8080
initialDelaySeconds: 30
periodSeconds: 30
readinessProbe:
httpGet:
path: /api/health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
volumes:
- name: data
persistentVolumeClaim:
claimName: gocommender-dataThe application includes build-time version information accessible via:
- Command line:
./gocommender -version - API endpoint:
GET /api/info - Health check:
GET /api/health
Version information includes:
- Application version
- Git commit hash
- Build timestamp
- Go version
- Platform (OS/architecture)
MIT License