Compare commits

..

20 Commits

Author SHA1 Message Date
Nick Stokoe
33dd1e288a root/defaults/mopidy.conf - update jellyfin hostname 2023-04-04 12:05:40 +01:00
Nick Stokoe
b593b8a59b root/defaults/mopidy.conf - add stub logging section 2023-04-04 12:05:40 +01:00
Nick Stokoe
bab61ed6ac root/defaults/mopidy.conf - don't exclude m4a 2023-04-04 12:05:40 +01:00
Nick Stokoe
aadba6e38c Dockerfile - fixup the packages
Include support for bash, sudo, and codecs for AAC/M4A/AVI
2023-04-04 12:05:40 +01:00
Nick Stokoe
d259232037 Dockerfile - clean up more after build
Rust isn't needed after building. Various other packages and caches
can be deleted.

setuptools needed to avoid error like:

     ModuleNotFoundError: No module named 'pkg_resources'
2023-04-04 12:05:40 +01:00
Nick Stokoe
faed23014d Dockerfile / mopidy.conf - add jellyfin plug-in 2023-04-04 12:05:40 +01:00
Nick Stokoe
7ccc2bfa12 root/defaults/mopidy.conf - enable streaming for upnp playing
upnp playing just won't work without this
2021-02-19 11:05:24 +00:00
Nick Stokoe
1aacba343b root/defaults/mopidy.conf - set locale to en_GB 2021-02-19 11:04:53 +00:00
Nick Stokoe
50a2f65917 root/usr/local/bin/entrypoint.sh - WIP disable icecast, always copy configs
We don't want the config to be untouched if we change it here, just
because it exists in some form already.
2021-02-19 11:03:56 +00:00
Nick Stokoe
d00bce295c Dockerfile - split package install/build into separate step
So one it's done, changes to later steps don't need to re-do it. It's slow!
2021-02-19 11:02:39 +00:00
Nick Stokoe
b7c6a7b4d9 Dockerfile - add alsa-utils package
For testing local sound
2021-02-19 11:00:51 +00:00
Nick Stokoe
22925e9d4f run.sh - don't launch icecast
as it hogs the audio device
2021-02-15 21:15:44 +00:00
Nick Stokoe
428bc8e255 mopidy.conf - use alsasink instead of shout2send 2021-02-15 21:15:20 +00:00
Nick Stokoe
1329a5160f Dockerfile, mopidy.conf - add mopidy user to audio group
So that it can use the ALSA sound device directly

(This also goes for icecast, which uses the same user `mopidy`)
2021-02-15 21:14:51 +00:00
Nick Stokoe
2e5e8719dd Dockerfile - lowercase ARG names, for consistency 2021-02-15 21:11:57 +00:00
Nick Stokoe
eca9867c79 Dockerfile - fixup remove comment cruft 2021-02-15 21:09:46 +00:00
Nick Stokoe
494fe3a4f9 Dockerfile - add Bandcamp and MPD plug-ins 2021-02-15 00:43:47 +00:00
Nick Stokoe
755ea4bd24 Dockerfile - update Local-Images and Local-SQLite -> Local
This supercedes those older plug-ins
2021-02-15 00:42:57 +00:00
Nick Stokoe
7e5ded3c01 Dockerfile - use recent alpine
Upgrade python package names to v3 versions.

Drop jfloff/alpine-python, it seems to get us two versions of python
which don't play together.

Don't upgrade pip - seems to cause problems with building

Add in all the prereqs, notably for building py3-cryptography, which
needs a bleedin' rust toolchain
2021-02-15 00:42:26 +00:00
Nick Stokoe
3ba2b8c06f Dockerfile - use ARG instead of ENV for PUID and PGID 2021-02-14 17:58:30 +00:00
4 changed files with 94 additions and 37 deletions

View File

@@ -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
View 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
View 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
View 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