Compare commits
20 Commits
c72deee4d5
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33dd1e288a | ||
|
|
b593b8a59b | ||
|
|
bab61ed6ac | ||
|
|
aadba6e38c | ||
|
|
d259232037 | ||
|
|
faed23014d | ||
|
|
7ccc2bfa12 | ||
|
|
1aacba343b | ||
|
|
50a2f65917 | ||
|
|
d00bce295c | ||
|
|
b7c6a7b4d9 | ||
|
|
22925e9d4f | ||
|
|
428bc8e255 | ||
|
|
1329a5160f | ||
|
|
2e5e8719dd | ||
|
|
eca9867c79 | ||
|
|
494fe3a4f9 | ||
|
|
755ea4bd24 | ||
|
|
7e5ded3c01 | ||
|
|
3ba2b8c06f |
89
Dockerfile
89
Dockerfile
@@ -1,72 +1,109 @@
|
||||
FROM jfloff/alpine-python:2.7
|
||||
ARG alpine_version=3.13
|
||||
|
||||
ENV PUID="${PUID:-1000}"
|
||||
ENV PGID="${PGID:-1000}"
|
||||
ENV PYTHONPATH="/usr/local/lib/python2.7/site-packages:/usr/lib/python2.7/site-packages"
|
||||
FROM alpine:$alpine_version
|
||||
# retrive alpine_version from before FROM
|
||||
ARG alpine_version
|
||||
|
||||
ARG puid=1000
|
||||
ARG pgid=1000
|
||||
ARG audio_gid=29
|
||||
|
||||
# This is an archive and isn't updated any more
|
||||
ARG spotify_version=12.1.51-Linux-x86_64
|
||||
|
||||
WORKDIR /mopidy
|
||||
|
||||
RUN \
|
||||
echo "* Updating Package Repositories" \
|
||||
&& echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/main' >> /etc/apk/repositories \
|
||||
&& echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/community' >> /etc/apk/repositories \
|
||||
&& echo "http://dl-cdn.alpinelinux.org/alpine/v${alpine_version}/main" >> /etc/apk/repositories \
|
||||
&& echo "http://dl-cdn.alpinelinux.org/alpine/v${alpine_version}/community" >> /etc/apk/repositories \
|
||||
&& apk upgrade --no-cache \
|
||||
&& pip install --upgrade pip \
|
||||
&& echo "* Installing Runtime Packages" \
|
||||
&& apk add -U --no-cache \
|
||||
coreutils \
|
||||
build-base \
|
||||
rust \
|
||||
cargo \
|
||||
su-exec \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
libffi-dev \
|
||||
openssl-dev \
|
||||
python2-dev \
|
||||
python3-dev \
|
||||
py3-setuptools \
|
||||
py3-pip \
|
||||
libcdio \
|
||||
libcaca \
|
||||
libvpx \
|
||||
v4l-utils-libs \
|
||||
py2-crypto \
|
||||
py2-gst \
|
||||
py-gobject \
|
||||
py3-requests \
|
||||
py3-crypto \
|
||||
py3-gst \
|
||||
py3-gobject3 \
|
||||
mailcap \
|
||||
icecast \
|
||||
gstreamer \
|
||||
gstreamer-tools \
|
||||
gst-plugins-base \
|
||||
gst-plugins-good \
|
||||
gst-plugins-bad \
|
||||
gst-plugins-ugly \
|
||||
&& pip install -U \
|
||||
gst-libav \
|
||||
alsa-utils \
|
||||
bash \
|
||||
sudo \
|
||||
&& pip3 install -U \
|
||||
pyopenssl \
|
||||
youtube-dl \
|
||||
pyasn1 \
|
||||
&& wget -c https://mopidy.github.io/libspotify-archive/libspotify-12.1.51-Linux-x86_64-release.tar.gz -O - | tar -xzC /tmp \
|
||||
&& make install -C /tmp/libspotify-12.1.51-Linux-x86_64-release prefix=/usr/local || true \
|
||||
&& wget -c https://mopidy.github.io/libspotify-archive/libspotify-${spotify_version}-release.tar.gz -O - | tar -xzC /tmp \
|
||||
&& make install -C /tmp/libspotify-${spotify_version}-release prefix=/usr/local || true \
|
||||
&& echo "* Installing Mopidy + Extensions" \
|
||||
&& pip install -U \
|
||||
&& pip3 install -U \
|
||||
Mopidy \
|
||||
Mopidy-Bandcamp \
|
||||
Mopidy-GMusic \
|
||||
Mopidy-Iris \
|
||||
Mopidy-Local \
|
||||
Mopidy-MPD \
|
||||
Mopidy-Jellyfin \
|
||||
Mopidy-Spotify-Web \
|
||||
Mopidy-SoundCloud \
|
||||
Mopidy-GMusic \
|
||||
Mopidy-Local-Images \
|
||||
Mopidy-Local-SQLite \
|
||||
&& 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" \
|
||||
&& rm -rf /var/cache/apk/* \
|
||||
&& rm -rf /root/.cache /root/.cargo \
|
||||
&& rm -rf /tmp/* \
|
||||
&& echo "* Ready to start Mopidy" \
|
||||
&& apk del \
|
||||
build-base \
|
||||
rust \
|
||||
cargo \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
libffi-dev \
|
||||
openssl-dev \
|
||||
python3-dev \
|
||||
py3-pip
|
||||
|
||||
|
||||
# Do this in a separate layer, because building the last is slooow
|
||||
# This allows us to alter these parameters without rebuilding the last.
|
||||
RUN \
|
||||
echo "* Creating Mopidy User" \
|
||||
&& addgroup -g ${pgid} mopidy \
|
||||
&& adduser -h /mopidy -s /bin/sh -D -G mopidy -u $puid mopidy \
|
||||
&& delgroup audio \
|
||||
&& addgroup -g ${audio_gid} audio \
|
||||
&& addgroup mopidy audio \
|
||||
&& echo "mopidy ALL=NOPASSWD: /usr/lib/python3.8/site-packages/mopidy_iris/system.sh" >> /etc/sudoers \
|
||||
&& echo "* Done" \
|
||||
&& sleep 1
|
||||
|
||||
COPY root/ /
|
||||
RUN chmod +x /usr/local/bin/run.sh
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/run.sh /usr/local/bin/entrypoint.sh
|
||||
EXPOSE 6600 6680 8000
|
||||
VOLUME /data /music
|
||||
|
||||
LABEL description "Open source media server"
|
||||
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
CMD ["run.sh"]
|
||||
#CMD ["run.sh"]
|
||||
|
||||
26
root/defaults/mopidy.conf
Executable file → Normal file
26
root/defaults/mopidy.conf
Executable file → Normal file
@@ -4,7 +4,8 @@ config_dir = /data/.config
|
||||
cache_dir = /data/.cache
|
||||
|
||||
[audio]
|
||||
output = lamemp3enc bitrate=320 ! shout2send async=false sync=true mount=mopidy
|
||||
#output = lamemp3enc bitrate=320 ! shout2send async=false sync=true mount=mopidy
|
||||
output = alsasink
|
||||
|
||||
[file]
|
||||
media_dirs = /music|Music
|
||||
@@ -14,7 +15,6 @@ excluded_file_extensions =
|
||||
.png
|
||||
.gif
|
||||
.bmp
|
||||
.m4a
|
||||
.itdb
|
||||
.itl
|
||||
|
||||
@@ -22,7 +22,7 @@ excluded_file_extensions =
|
||||
enabled = false
|
||||
|
||||
[stream]
|
||||
enabled = false
|
||||
enabled = true
|
||||
|
||||
[local]
|
||||
library = images
|
||||
@@ -34,7 +34,6 @@ excluded_file_extensions =
|
||||
.png
|
||||
.gif
|
||||
.bmp
|
||||
.m4a
|
||||
.itdb
|
||||
.itl
|
||||
|
||||
@@ -44,13 +43,19 @@ image_dir = /data/.images
|
||||
|
||||
[http]
|
||||
hostname = 0.0.0.0
|
||||
port = 6680
|
||||
|
||||
[mpd]
|
||||
enabled = true
|
||||
# Useful if you want to control this instance from a remote MPD client
|
||||
hostname = 0.0.0.0
|
||||
port = 6600
|
||||
# This will help avoid timeout errors for artists or folders with large amounts of files
|
||||
connection_timeout = 300
|
||||
|
||||
[iris]
|
||||
country = US
|
||||
locale = en_US
|
||||
country = GB
|
||||
locale = en_GB
|
||||
|
||||
[spotify]
|
||||
username =
|
||||
@@ -75,3 +80,12 @@ auth_token =
|
||||
[scrobbler]
|
||||
username =
|
||||
password =
|
||||
|
||||
[jellyfin]
|
||||
hostname = jellyfin:8096
|
||||
username = mopidy
|
||||
password = 66Hky1XQL1oTg
|
||||
libraries = Music
|
||||
|
||||
[logging]
|
||||
#verbosity = 1
|
||||
|
||||
14
root/usr/local/bin/entrypoint.sh
Normal file → Executable file
14
root/usr/local/bin/entrypoint.sh
Normal file → Executable file
@@ -4,8 +4,9 @@ set -euo pipefail
|
||||
|
||||
[ ! -r /data/.config ] && mkdir -p /data/.config
|
||||
[ ! -r /data/.images ] && mkdir -p /data/.images
|
||||
[ ! -r /data/.config/mopidy.conf ] && cp /defaults/mopidy.conf /data/.config
|
||||
[ ! -r /data/.config/icecast.xml ] && cp /defaults/icecast.xml /data/.config
|
||||
#[ ! -r /data/.config/mopidy.conf ] && cp /defaults/mopidy.conf /data/.config
|
||||
#[ ! -r /data/.config/icecast.xml ] && cp /defaults/icecast.xml /data/.config
|
||||
cp -f /defaults/mopidy.conf /defaults/icecast.xml /data/.config
|
||||
|
||||
if [ ! -r /data/icecast/web ] || [ ! -r /data/icecast/admin ] || [ ! -r /data/icecast/logs ]; then
|
||||
mkdir -p /data/icecast/web /data/icecast/admin /data/icecast/logs
|
||||
@@ -14,5 +15,10 @@ if [ ! -r /data/icecast/web ] || [ ! -r /data/icecast/admin ] || [ ! -r /data/ic
|
||||
fi
|
||||
|
||||
chown -R mopidy:mopidy /data
|
||||
su-exec mopidy mopidy --config /data/.config/mopidy.conf local scan
|
||||
exec "${@}"
|
||||
#su-exec mopidy mopidy --config /data/.config/mopidy.conf local scan
|
||||
|
||||
#trap "kill $PID" HUP INT TERM
|
||||
#su-exec mopidy icecast -c /data/.config/icecast.xml -b &
|
||||
su-exec mopidy mopidy --config /data/.config/mopidy.conf "${@}"
|
||||
#PID=$!
|
||||
#wait $PID
|
||||
|
||||
2
root/usr/local/bin/run.sh
Executable file → Normal file
2
root/usr/local/bin/run.sh
Executable file → Normal file
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
trap "kill $PID" HUP INT TERM
|
||||
su-exec mopidy icecast -c /data/.config/icecast.xml -b &
|
||||
#su-exec mopidy icecast -c /data/.config/icecast.xml -b &
|
||||
su-exec mopidy mopidy --config /data/.config/mopidy.conf "${@}" &
|
||||
PID=$!
|
||||
wait $PID
|
||||
|
||||
Reference in New Issue
Block a user