Saltar a contenido

beets — Compose

services:
  beets:
    build:
      context: .
      dockerfile: Dockerfile
    image: beets:local
    container_name: beets
    profiles:
      - manual
    volumes:
      - /opt/docker/beets/config:/config
      - /mnt/hdd_2tb/navidrome_music:/music:ro
    environment:
      - TZ=America/Argentina/Buenos_Aires
    entrypoint: ["tail", "-f", "/dev/null"]
    restart: "no"

beets config

/opt/docker/beets/config/config.yaml:

directory: /music
library: /config/library.db

import:
  move: no
  copy: no
  autotag: yes
  quiet: yes
  timid: no
  resume: false
  incremental: no
  languages: en

plugins: lyrics fetchart embedart lastgenre

lyrics:
  auto: yes
  sources:
    - genius
    - lyrics.ovh
  fallback: ""

fetchart:
  auto: yes
  sources:
    - filesystem
    - coverart
    - itunes
  maxwidth: 500
  enforce_ratio: no

embedart:
  auto: yes
  remove_art_file: yes
  ifempty: yes
  compare_threshold: 0

lastgenre:
  auto: yes
  canonical: yes
  source: album
  minweight: 10
  whitelist: yes

Lidarr Custom Script

/opt/docker/beets/lidarr-import.sh — ejecutado por Lidarr post-import.

Montado en Lidarr via volume bind en compose:

volumes:
  - /opt/docker/beets:/beets:ro
  - /var/run/docker.sock:/var/run/docker.sock

Dockerfile

FROM python:3.12-slim

RUN pip install --no-cache-dir \
    beets \
    pillow \
    requests \
    beautifulsoup4 \
    pylast \
    librosa

COPY config/config.yaml /config/config.yaml
COPY lidarr-import.sh /usr/local/bin/lidarr-import.sh
COPY bpm.py /usr/local/bin/bpm.py

RUN chmod +x /usr/local/bin/lidarr-import.sh

WORKDIR /music

ENTRYPOINT ["beet", "-c", "/config/config.yaml"]
CMD ["--help"]

Notas

  • La imagen se construye localmente (beets:local), no se sube a ningún registro
  • librosa es necesario para el análisis de BPM
  • No exponer puertos (no corre como daemon)