commit 1601b62e29ddfd1d14244c65c5abcc2531ef2465 Author: Wouter Habets Date: Sat Aug 6 13:24:21 2016 +0200 Init diff --git a/README.md b/README.md new file mode 100644 index 0000000..ce5a559 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +Mopidy +====== +Image for running Mopidy in Docker. +Based on [wernight/docker-mopidy](https://github.com/wernight/docker-mopidy). + +## How to use +```bash + docker run \ + --name mopidy \ + -e PULSE_SERVER=tcp:127.0.0.1:4713 \ # Pulseaudio server for sound + -v $PWD/media:/var/lib/mopidy/media:ro \ # Media files + -v $PWD/local:/var/lib/mopidy/local \ # Some kind of music storage(?) + -v $PWD/account-config:/var/lib/mopidy/.config/mopidy/account-config \ # Place here the account configurations (see account-config.conf) + -p 6600:6600 \ # Port for MPD + -p 6680:6680 \ # Port for the webinterface + whhoesj/mopidy-web +``` \ No newline at end of file diff --git a/base/Dockerfile b/base/Dockerfile new file mode 100644 index 0000000..bf25201 --- /dev/null +++ b/base/Dockerfile @@ -0,0 +1,49 @@ +FROM debian:jessie +MAINTAINER Wouter Habets (wouterhabets@gmail.com) + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + curl \ + && curl -L https://apt.mopidy.com/mopidy.gpg -o /tmp/mopidy.gpg \ + && curl -L https://apt.mopidy.com/mopidy.list -o /etc/apt/sources.list.d/mopidy.list \ + && apt-key add /tmp/mopidy.gpg \ + && apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + mopidy \ + mopidy-scrobbler \ + mopidy-soundcloud \ + mopidy-spotify \ + mopidy-spotify-tunigo \ + mopidy-tunein \ + git \ + gstreamer0.10-plugins-bad \ + gstreamer0.10-alsa \ + gstreamer1.0-libav \ + python-crypto \ + python-setuptools + +RUN curl -L https://bootstrap.pypa.io/get-pip.py | python - +RUN pip install -U six \ + && pip install markerlib \ + && pip install Mopidy-YouTube \ + && pip install Mopidy-Local-SQLite \ + && pip install --upgrade pafy + +ADD mopidy.conf /var/lib/mopidy/.config/mopidy/mopidy.conf + +ADD entrypoint.sh /entrypoint.sh + +RUN chown mopidy:audio -R /var/lib/mopidy/.config \ + && chown mopidy:audio /entrypoint.sh + +USER mopidy + +VOLUME /var/lib/mopidy/local +VOLUME /var/lib/mopidy/media +VOLUME /var/lib/mopidy/.config/mopidy/account-config + +EXPOSE 6600 +EXPOSE 6680 + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["/usr/bin/mopidy"] diff --git a/base/accounts.conf b/base/accounts.conf new file mode 100644 index 0000000..41ce79f --- /dev/null +++ b/base/accounts.conf @@ -0,0 +1,10 @@ +[spotify] +username= +password= + +[scrobbler] +username= +password= + +[soundcloud] +auth_token= diff --git a/base/entrypoint.sh b/base/entrypoint.sh new file mode 100755 index 0000000..bfb53fa --- /dev/null +++ b/base/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +mopidy local scan + +if [[ "$PULSE_COOKIE_DATA" != "" ]] +then + echo -ne $(echo $PULSE_COOKIE_DATA | sed -e 's/../\\x&/g') >$HOME/pulse.cookie + export PULSE_COOKIE=$HOME/pulse.cookie +fi + +exec /usr/bin/mopidy --config /var/lib/mopidy/.config/mopidy/mopidy.conf:/var/lib/mopidy/.config/mopidy/account-config/accounts.conf diff --git a/base/mopidy.conf b/base/mopidy.conf new file mode 100644 index 0000000..1ab9ef5 --- /dev/null +++ b/base/mopidy.conf @@ -0,0 +1,107 @@ +# For further information about options in this file see: +# http://docs.mopidy.com/ +# +# The initial commented out values reflect the defaults as of: +# Mopidy 0.19.4 +# Mopidy-HTTP 0.19.4 +# Mopidy-Local 0.19.4 +# Mopidy-MPD 0.19.4 +# Mopidy-SoftwareMixer 0.19.4 +# Mopidy-Stream 0.19.4 +# +# Available options and defaults might have changed since then, +# run `mopidy config` to see the current effective config and +# `mopidy --version` to check the current version. + +[logging] +#color = true +#console_format = %(levelname)-8s %(message)s +#debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s +#debug_file = mopidy.log +#config_file = + +[audio] +#mixer = software +mixer_volume = 10 +#output = autoaudiosink +#visualizer = + +[proxy] +#scheme = +#hostname = +#port = +#username = +#password = + +[local] +enabled = true +#library = json +media_dir = /var/lib/mopidy/media +data_dir = /var/lib/mopidy/local +#playlists_dir = /var/lib/mopidy/playlists +#scan_timeout = 1000 +#scan_flush_threshold = 1000 +#excluded_file_extensions = +# .directory +# .html +# .jpeg +# .jpg +# .log +# .nfo +# .png +# .txt + +[mpd] +enabled = true +hostname = 0.0.0.0 +port = 6600 +#password = dada123 +max_connections = 20 +connection_timeout = 60 +zeroconf = Mopidy MPD server on $hostname + +[softwaremixer] +#enabled = true + +[http] +enabled = true +hostname = 0.0.0.0 +port = 6680 +#static_dir = +zeroconf = Mopidy HTTP server on $hostname + +[stream] +enabled = true +protocols = + http + https + mms + rtmp + rtmps + rtsp +#metadata_blacklist = +#timeout = 5000 + +[spotify] +enabled = true +#username = +#password = +bitrate = 320 + +[spotify_tunigo] +enabled = true +region = all + +[tunein] +enabled = false + +[soundcloud] +enabled = true +#auth_token = + +[scrobbler] +enabled = true +#username = +#password = + + diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 0000000..ee03e7e --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,9 @@ +FROM whhoesj/mopidy:latest +MAINTAINER Wouter Habets (wouterhabets@gmail.com) + +USER root +RUN pip install Mopidy-Mopify \ + && pip install Mopidy-Spotmop \ + && pip install Mopidy-MusicBox-Webclient \ + && pip install Mopidy-API-Explorer +USER mopidy