Add Snapcast support
This commit is contained in:
@@ -37,6 +37,11 @@ RUN pip install Mopidy-Mopify \
|
|||||||
&& pip install Mopidy-MusicBox-Webclient \
|
&& pip install Mopidy-MusicBox-Webclient \
|
||||||
&& pip install Mopidy-API-Explorer
|
&& pip install Mopidy-API-Explorer
|
||||||
|
|
||||||
|
ADD snapserver.deb /tmp/snapserver.deb
|
||||||
|
RUN apt-get install -y libavahi-client3 libavahi-common3 \
|
||||||
|
&& dpkg -i /tmp/snapserver.deb \
|
||||||
|
&& apt-get install -f \
|
||||||
|
&& rm /tmp/snapserver.deb
|
||||||
|
|
||||||
ADD mopidy.conf /var/lib/mopidy/.config/mopidy/mopidy.conf
|
ADD mopidy.conf /var/lib/mopidy/.config/mopidy/mopidy.conf
|
||||||
|
|
||||||
@@ -53,6 +58,10 @@ VOLUME /var/lib/mopidy/.config/mopidy/account-config
|
|||||||
|
|
||||||
EXPOSE 6600
|
EXPOSE 6600
|
||||||
EXPOSE 6680
|
EXPOSE 6680
|
||||||
|
EXPOSE 1704
|
||||||
|
EXPOSE 1705
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["/usr/bin/mopidy"]
|
CMD ["/usr/bin/mopidy"]
|
||||||
|
|
||||||
|
ADD audio.conf /var/lib/mopidy/.config/mopidy/audio.conf
|
||||||
|
|||||||
21
Makefile
Normal file
21
Makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
all: snapcast pulseaudio
|
||||||
|
|
||||||
|
snapcast:
|
||||||
|
cp audio-snapcast.conf audio.conf
|
||||||
|
docker build -t whhoesj/mopidy:snapcast .
|
||||||
|
docker build -t whhoesj/mopidy:latest .
|
||||||
|
|
||||||
|
pulseaudio:
|
||||||
|
cp audio-pulseaudio.conf audio.conf
|
||||||
|
docker build -t whhoesj/mopidy:pulseaudio .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push whhoesj/mopidy:pulseaudio
|
||||||
|
docker push whhoesj/mopidy:snapcast
|
||||||
|
docker push whhoesj/mopidy:latest
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-rm -rfv audio.conf
|
||||||
|
-docker rmi whhoesj/mopidy:pulseaudio
|
||||||
|
-docker rmi whhoesj/mopidy:snapcast
|
||||||
|
-docker rmi whhoesj/mopidy:latest
|
||||||
22
README.md
22
README.md
@@ -1,17 +1,23 @@
|
|||||||
Mopidy
|
# Mopidy
|
||||||
======
|
Image for running [Mopidy](https://www.mopidy.com/) in Docker.
|
||||||
Image for running Mopidy in Docker.
|
Supports audio output with Pulseaudio or [Snapcast](https://github.com/badaix/snapcast).
|
||||||
Based on [wernight/docker-mopidy](https://github.com/wernight/docker-mopidy).
|
|
||||||
|
## Tags
|
||||||
|
`latest` and `snapcast` uses Snapcast for audio output
|
||||||
|
`pulseaudio` uses Pulseaudio for audio output
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
```bash
|
```bash
|
||||||
docker run \
|
docker run \
|
||||||
--name mopidy \
|
--name mopidy \
|
||||||
-e PULSE_SERVER=tcp:127.0.0.1:4713 \ # Pulseaudio server for sound
|
-e PULSE_SERVER=tcp:127.0.0.1:4713 \ # (Optional) Pulseaudio server for sound
|
||||||
|
-e USE_SNAPCAST=true \ # Set true to activate Snapcast (event with the Snapcast image)
|
||||||
-v $PWD/media:/var/lib/mopidy/media:ro \ # Media files
|
-v $PWD/media:/var/lib/mopidy/media:ro \ # Media files
|
||||||
-v $PWD/local:/var/lib/mopidy/local \ # Some kind of music storage(?)
|
-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)
|
-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 6600:6600 \ # Port for MPD
|
||||||
-p 6680:6680 \ # Port for the webinterface
|
-p 6680:6680 \ # Port for the webinterface
|
||||||
whhoesj/mopidy-web
|
-p 1704:1704 \ # Port for Snapcast streaming
|
||||||
```
|
-p 1705:1705 \ # Port for Snapcast control
|
||||||
|
whhoesj/mopidy
|
||||||
|
```
|
||||||
|
|||||||
5
audio-pulseaudio.conf
Normal file
5
audio-pulseaudio.conf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[output]
|
||||||
|
# USE THIS FOR PULSEAUDIO
|
||||||
|
output = autoaudiosink
|
||||||
|
# USE THIS FOR SNAPCAST
|
||||||
|
#output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo
|
||||||
5
audio-snapcast.conf
Normal file
5
audio-snapcast.conf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[output]
|
||||||
|
# USE THIS FOR PULSEAUDIO
|
||||||
|
#output = autoaudiosink
|
||||||
|
# USE THIS FOR SNAPCAST
|
||||||
|
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
mopidy local scan
|
if [ "$USE_SNAPCAST" = true ] ; then
|
||||||
|
snapserver -d
|
||||||
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
|
fi
|
||||||
|
|
||||||
exec /usr/bin/mopidy --config /var/lib/mopidy/.config/mopidy/mopidy.conf:/var/lib/mopidy/.config/mopidy/account-config/accounts.conf
|
exec /usr/bin/mopidy --config /var/lib/mopidy/.config/mopidy/mopidy.conf:/var/lib/mopidy/.config/mopidy/account-config/accounts.conf:/var/lib/mopidy/.config/mopidy/account-config/audio.conf
|
||||||
|
|||||||
3
local-scan.sh
Executable file
3
local-scan.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
docker exec -it mopidy mopidy local scan
|
||||||
12
mopidy.conf
12
mopidy.conf
@@ -21,9 +21,9 @@
|
|||||||
#config_file =
|
#config_file =
|
||||||
|
|
||||||
[audio]
|
[audio]
|
||||||
|
# Check audio.conf for audio output config
|
||||||
#mixer = software
|
#mixer = software
|
||||||
mixer_volume = 10
|
mixer_volume = 10
|
||||||
#output = autoaudiosink
|
|
||||||
#visualizer =
|
#visualizer =
|
||||||
|
|
||||||
[proxy]
|
[proxy]
|
||||||
@@ -55,7 +55,7 @@ data_dir = /var/lib/mopidy/local
|
|||||||
enabled = true
|
enabled = true
|
||||||
hostname = 0.0.0.0
|
hostname = 0.0.0.0
|
||||||
port = 6600
|
port = 6600
|
||||||
#password = dada123
|
#password =
|
||||||
max_connections = 20
|
max_connections = 20
|
||||||
connection_timeout = 60
|
connection_timeout = 60
|
||||||
zeroconf = Mopidy MPD server on $hostname
|
zeroconf = Mopidy MPD server on $hostname
|
||||||
@@ -84,8 +84,8 @@ protocols =
|
|||||||
|
|
||||||
[spotify]
|
[spotify]
|
||||||
enabled = true
|
enabled = true
|
||||||
#username =
|
#username =
|
||||||
#password =
|
#password =
|
||||||
bitrate = 320
|
bitrate = 320
|
||||||
|
|
||||||
[spotify_tunigo]
|
[spotify_tunigo]
|
||||||
@@ -96,11 +96,11 @@ region = all
|
|||||||
enabled = false
|
enabled = false
|
||||||
|
|
||||||
[soundcloud]
|
[soundcloud]
|
||||||
enabled = true
|
enabled = false
|
||||||
#auth_token =
|
#auth_token =
|
||||||
|
|
||||||
[scrobbler]
|
[scrobbler]
|
||||||
enabled = true
|
enabled = false
|
||||||
#username =
|
#username =
|
||||||
#password =
|
#password =
|
||||||
|
|
||||||
|
|||||||
BIN
snapserver.deb
Normal file
BIN
snapserver.deb
Normal file
Binary file not shown.
Reference in New Issue
Block a user