Skip to content
rawdlite edited this page May 1, 2017 · 9 revisions

mopidy in a docker container

To install mopidy plus its various extensions can be quite a drag. Incompatible libraries and updates breaking setups can be avoided by containerising the app. This docker image gives you:

  • Mopidy
  • Mopidy-ALSAMixer
  • Mopidy-Yamaha
  • Mopidy-Spotify
  • Mopidy-Somafm
  • Mopidy-Soundcloud
  • Mopidy-BeetsLocal
  • Mopidy-Mobile

Build the image as described in the README

By mapping the directories you can accommodate a local and a dockerized instance.

docker run -d
--name mopidy
--net host
--device /dev/snd
-v ~/.config/mopidy/mopidy-docker.conf:/root/.config/mopidy/mopidy.conf
-v /data/raid1/music/:/data/raid1/music/
-v ~/.config/beets/:/root/.config/beets/
-v ~/.local/share/mopidy/bigbeet/:/root/.local/share/mopidy/bigbeet/
rawdlite/mopidy:bigbeet

of course you need to adapt the directories according to your file system. The mapping of ~/.config/mopidy/mopidy-docker.conf allows for the container to run alongside an existing mopidy instance. Just edit the mpd and http port. And maybe the audio device.

You can check your configuration with:

docker exec mopidy mopidy config

mopidy bigbeet uses a genre tree for browsing.

For defining the genre tree 2 files are used.

genres.txt defines which genre names are accepted genres-tree.yaml defines the tree structure. i provided sample files to get you started, that can be copied with:

docker exec mopidy setup.sh

it is probably best to reference these files also in the beets config:

lastgenre: canonical: ~/.local/share/mopidy/bigbeet/genres-tree.yaml whitelist: ~/.local/share/mopidy/bigbeet/genres.txt

You can use beets inside the container like so:

docker exec mopidy beet ls Aphex Twin and so on.

to keep the bigbeet database in sync to the beets library, you need to point beets to the bigbeet plugin.

`pluginpath: [~/.local/share/mopidy/bigbeet/beetsplug/]

plugins: web lyrics edit duplicates bigbeet copyartifacts lastgenre missing fuzzy ftintitle info`

You can check the active configuration being used by

`docker exec beet config``

This should already be set correctly in the docker. Any changes in the beets database will then be synchronized to the bigbeet repository.

if you already have a beets library to begin with, you can scan it with

docker exec mopidy mopidy bigbeet scan

Clone this wiki locally