This commit is contained in:
Brandon
2019-08-24 03:03:39 -05:00
parent e8abccfb93
commit 8683c4e24a
6 changed files with 97 additions and 9 deletions

View File

@@ -16,20 +16,22 @@ RUN \
&& echo "* Installing Runtime Packages" \
&& apk add -U --no-cache \
coreutils \
libcdio \
libcaca \
su-exec \
libxml2-dev \
libxslt-dev \
libvpx \
libffi-dev \
openssl-dev \
v4l-utils-libs \
python2-dev \
libcdio \
libcaca \
libvpx \
v4l-utils-libs \
py2-crypto \
py2-gst \
py-gobject \
mailcap \
su-exec \
icecast \
snapcast-server \
gstreamer \
gst-plugins-base \
gst-plugins-good \
@@ -52,7 +54,14 @@ RUN \
&& echo "* Creating Mopidy User" \
&& addgroup -g ${PGID} mopidy \
&& adduser -h /mopidy -s /bin/sh -D -G mopidy -u ${PUID} mopidy \
&& echo "mopidy ALL=NOPASSWD: /usr/local/lib/pyenv/versions/2.7.16/lib/python2.7/site-packages/mopidy_iris/system.sh" >> /etc/sudoers \
&& echo "* Cleaning up" \
&& apk --purge del \
libxml2-dev \
libxslt-dev \
libffi-dev \
openssl-dev \
python2-dev \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* \
&& echo "* Ready to start Mopidy" \
@@ -61,7 +70,7 @@ RUN \
COPY root/ /
RUN chmod +x /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 6600 6680 8000 5555/udp
EXPOSE 6600 6680 8000 1704 1705
VOLUME /data /music /playlists
LABEL description "Open source media server"

41
root/defaults/icecast.xml Normal file
View File

@@ -0,0 +1,41 @@
<icecast>
<hostname>icecast.local</hostname>
<location>local</location>
<admin>noreply@icecast.local</admin>
<fileserve>1</fileserve>
<limits>
<burst-on-connect>0</burst-on-connect>
</limits>
<authentication>
<source-password>hackme</source-password>
<relay-password>hackme</relay-password>
<admin-user>admin</admin-user>
<admin-password>hackme</admin-password>
</authentication>
<listen-socket>
<port>8000</port>
<bind-address>0.0.0.0</bind-address>
</listen-socket>
<mount>
<mount-name>/mopidy</mount-name>
<fallback-mount>/silence.mp3</fallback-mount>
<fallback-override>1</fallback-override>
</mount>
<paths>
<logdir>/data/icecast/logs</logdir>
<webroot>/data/icecast/web</webroot>
<adminroot>/data/icecast/admin</adminroot>
<alias source="/" destination="/status.xsl"/>
</paths>
<logging>
<loglevel>3</loglevel>
<logsize>10000</logsize>
</logging>
</icecast>

View File

@@ -1,10 +1,10 @@
[core]
cache_dir = /data/.cache
config_dir = /data/.config
data_dir = /data
config_dir = /data/.config
cache_dir = /data/.cache
[audio]
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo
output = lamemp3enc bitrate=320 ! shout2send async=false mount=mopidy ip=0.0.0.0 port=8000 password=hackme
[file]
media_dirs = /music|Music
@@ -12,6 +12,7 @@ media_dirs = /music|Music
[local]
library = images
media_dir = /music
scan_flush_threshold = 100
[local-images]
library = sqlite
@@ -28,3 +29,27 @@ snapcast_host = snapserver
snapcast_port = 1705
country = US
locale = en_US
[spotify]
username =
password =
client_id =
client_secret =
bitrate = 320
[spotify_web]
client_id =
client_secret =
[gmusic]
username =
password =
deviceid = mac
bitrate = 320
[soundcloud]
auth_token =
[scrobbler]
username =
password =

BIN
root/defaults/silence.mp3 Normal file

Binary file not shown.

View File

@@ -7,6 +7,17 @@ if [ ! -r /data/.config/mopidy.conf ]; then
cp /defaults/mopidy.conf /data/.config
fi
if [ ! -r /data/.config/icecast.xml ]; then
mkdir -p /data/.config
cp /defaults/icecast.xml /data/.config
fi
if [ ! -r /data/icecast ]; then
mkdir -p /data/icecast/logs
cp -r /usr/share/icecast /data/icecast
cp /defaults/silence.mp3 /data/icecast/web/silence.mp3
fi
chown -R mopidy:mopidy /data
su-exec mopidy mopidy --config /data/.config/mopidy.conf local scan

View File

@@ -1,6 +1,8 @@
#!/bin/sh
trap "kill $PID" HUP INT TERM
su-exec mopidy snapserver -s pipe:///tmp/snapfifo?name=Mopidy&sampleformat=48000:16:2 -d &
su-exec mopidy icecast -c /data/.config/icecast.xml -b &
su-exec mopidy mopidy --config /data/.config/mopidy.conf "${@}" &
PID=$!
wait $PID