2015-04-21 15:46:55 +02:00
2015-04-21 15:13:36 +02:00
2015-04-21 15:46:55 +02:00
2015-04-21 15:13:36 +02:00
2015-04-21 15:46:55 +02:00

docker-mopidy

Containerized Mopidy music server with support for MPD clients and HTTP clients.

Features

You may install additional backend extensions.

Usage

General usage (see mopidy commands):

$ docker run -d \
      -v /dev/snd:/dev/snd --lxc-conf='lxc.cgroup.devices.allow = c 116:* rwm' \
      -v $PWD/media:/var/lib/mopidy/media:ro \
      -v $PWD/local:/var/lib/mopidy/local \
      -p 6600:6600 -p 6680:6680 \
      wernight/mopidy \
      -o spotify/username=USERNAME -o spotify/password=PASSWORD \
      -o gmusic/username=USERNAME -o gmusic/password=PASSWORD \
      -o soundcloud/auth_token=TOKEN

Most elements are optional (see some examples below). Replace USERNAME, PASSWORD, TOKEN accordingly if needed, or disable services (e.g., -o spotify/enabled=false):

  • For Spotify you'll need a Premium account.
  • For Google Music use your Google account (if you have 2-Step Authentication, generate an app specific password).
  • For SoundCloud, just get a token after registering.

Ports:

  • 6600 - MPD server
  • 6680 - HTTP server

Volumes:

  • /var/lib/mopidy/media - Path to directory with local media files (optional).
  • /var/lib/mopidy/local - Path to directory to store local metadata such as libraries and playlists in (optional).
  • /dev/snd - Used to share ALSA socket and play audio along with --lxc-conf (see http://stackoverflow.com/q/28985714/167897).

Example using HTTP client to stream local files

  1. Give read access to your audio files to user 102 (mopidy), group 29 (audio), or all users (e.g., $ chgrp -R 29 $PWD/media && chmod -R g+r $PWD/media).

  2. Index local files:

    $ docker run --rm -v $PWD/media:/var/lib/mopidy/media:ro -v $PWD/local:/var/lib/mopidy/local -p 6800:6800 wernight/mopidy local scan
    
  3. Start the server:

    $ docker run -d -v $PWD/media:/var/lib/mopidy/media:ro -v $PWD/local:/var/lib/mopidy/local -p 6800:6800 wernight/mopidy
    
  4. Browse to http://localhost:6800/

Example using ncmpcpp MPD console client

$ docker run --name mopidy -d wernight/mopidy
$ docker run --rm -it --link mopidy:mopidy wernight/ncmpcpp --host mopidy

Feedbacks

Having more issues? Report a bug on GitHub.

Description
Containerized Mopidy MPD (Music Player Daemon) along with Spotify, Google Music... plugins.
Readme 272 KiB
Languages
Dockerfile 92.3%
Shell 7.7%