2021-10-24 11:54:43 +13:00
|
|
|
FROM debian:buster
|
2020-01-22 21:55:22 +13:00
|
|
|
|
2019-12-24 11:58:09 +13:00
|
|
|
# Switch to the root user while we do our changes
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
|
|
# Install GStreamer and other required Debian packages
|
|
|
|
|
RUN apt-get update \
|
2021-03-27 17:47:55 +01:00
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
|
wget \
|
|
|
|
|
gnupg2 \
|
|
|
|
|
git \
|
|
|
|
|
python3-setuptools \
|
|
|
|
|
python3-pip \
|
2019-12-24 11:58:09 +13:00
|
|
|
dumb-init \
|
|
|
|
|
graphviz-dev \
|
|
|
|
|
gstreamer1.0-plugins-bad \
|
|
|
|
|
gstreamer1.0-plugins-good \
|
|
|
|
|
gstreamer1.0-plugins-ugly \
|
2020-01-23 10:37:22 +13:00
|
|
|
gstreamer1.0-pulseaudio \
|
2019-12-24 11:58:09 +13:00
|
|
|
libasound2-dev \
|
2021-03-27 17:47:55 +01:00
|
|
|
python3-dev \
|
2019-12-24 11:58:09 +13:00
|
|
|
python3-gst-1.0 \
|
2020-12-05 21:40:34 +13:00
|
|
|
build-essential \
|
|
|
|
|
libdbus-glib-1-dev \
|
|
|
|
|
libgirepository1.0-dev \
|
|
|
|
|
dleyna-server \
|
2021-05-09 20:13:44 +12:00
|
|
|
sudo \
|
2019-12-24 11:58:09 +13:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Install libspotify-dev from apt.mopidy.com
|
2022-03-31 20:37:13 +02:00
|
|
|
RUN mkdir -p /usr/local/share/keyrings \
|
|
|
|
|
&& wget -q -O /usr/local/share/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg \
|
2019-12-24 11:58:09 +13:00
|
|
|
&& wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list \
|
|
|
|
|
&& apt-get update \
|
2022-01-29 22:42:20 +13:00
|
|
|
&& apt-get install -y libspotify-dev mopidy-spotify \
|
2019-12-24 11:58:09 +13:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2020-01-22 21:55:22 +13:00
|
|
|
# Clone Iris from the repository and install in development mode.
|
|
|
|
|
# This allows a binding at "/iris" to map to your local folder for development, rather than
|
|
|
|
|
# installing using pip.
|
2021-10-24 11:54:43 +13:00
|
|
|
# Note using ADD helps prevent caching issues. When HEAD changes, our cache is invalidated, whee!
|
|
|
|
|
ADD https://api.github.com/repos/jaedb/Iris/git/refs/heads/master version.json
|
2022-04-17 06:46:46 +02:00
|
|
|
RUN git clone --depth 1 -b master https://github.com/jaedb/Iris.git /iris \
|
2020-04-14 08:53:40 +12:00
|
|
|
&& cd /iris \
|
2021-03-27 17:47:55 +01:00
|
|
|
&& python3 setup.py develop \
|
2020-01-22 21:55:22 +13:00
|
|
|
&& mkdir -p /var/lib/mopidy/.config \
|
|
|
|
|
&& ln -s /config /var/lib/mopidy/.config/mopidy \
|
|
|
|
|
# Allow mopidy user to run system commands (restart, local scan, etc)
|
|
|
|
|
&& echo "mopidy ALL=NOPASSWD: /iris/mopidy_iris/system.sh" >> /etc/sudoers
|
2019-04-20 08:50:43 +12:00
|
|
|
|
2020-01-22 21:55:22 +13:00
|
|
|
# Install additional Python dependencies
|
2021-03-27 17:47:55 +01:00
|
|
|
RUN python3 -m pip install --no-cache \
|
2020-04-29 11:31:39 +12:00
|
|
|
tox \
|
|
|
|
|
mopidy-mpd \
|
|
|
|
|
mopidy-local \
|
2020-12-05 21:40:34 +13:00
|
|
|
dbus-python \
|
2020-04-29 11:31:39 +12:00
|
|
|
# pip not up-to-date for Mopidy-Tidal (https://github.com/tehkillerbee/mopidy-tidal/issues/14)
|
|
|
|
|
git+https://github.com/tehkillerbee/mopidy-tidal.git@master
|
2019-12-24 13:52:50 +13:00
|
|
|
|
2019-04-20 08:50:43 +12:00
|
|
|
# Start helper script.
|
2019-04-22 14:24:10 +12:00
|
|
|
COPY docker/entrypoint.sh /entrypoint.sh
|
2019-04-20 08:50:43 +12:00
|
|
|
|
|
|
|
|
# Default configuration.
|
2019-08-12 07:30:23 +12:00
|
|
|
COPY docker/mopidy.example.conf /config/mopidy.conf
|
2019-04-20 08:50:43 +12:00
|
|
|
|
|
|
|
|
# Copy the pulse-client configuratrion.
|
2019-04-22 14:24:10 +12:00
|
|
|
COPY docker/pulse-client.conf /etc/pulse/client.conf
|
2019-04-20 08:50:43 +12:00
|
|
|
|
2020-02-11 09:53:03 +13:00
|
|
|
# Add version info to image
|
|
|
|
|
COPY VERSION /
|
2019-12-24 11:58:09 +13:00
|
|
|
|
2019-04-20 08:50:43 +12:00
|
|
|
# Allows any user to run mopidy, but runs by default as a randomly generated UID/GID.
|
2022-01-29 22:42:20 +13:00
|
|
|
# RUN useradd -ms /bin/bash mopidy
|
2020-01-22 21:55:22 +13:00
|
|
|
ENV HOME=/var/lib/mopidy
|
|
|
|
|
RUN set -ex \
|
|
|
|
|
&& usermod -G audio,sudo mopidy \
|
2020-04-14 08:53:40 +12:00
|
|
|
&& mkdir /var/lib/mopidy/local \
|
2020-01-22 21:55:22 +13:00
|
|
|
&& chown mopidy:audio -R $HOME /entrypoint.sh /iris \
|
2020-02-10 07:15:22 +13:00
|
|
|
&& chmod go+rwx -R $HOME /entrypoint.sh /iris \
|
2020-02-11 09:53:03 +13:00
|
|
|
&& echo "1" >> /IS_CONTAINER
|
2020-01-22 21:55:22 +13:00
|
|
|
|
|
|
|
|
# Runs as mopidy user by default.
|
|
|
|
|
USER mopidy:audio
|
|
|
|
|
|
2020-04-14 08:53:40 +12:00
|
|
|
VOLUME ["/var/lib/mopidy/local"]
|
2019-04-20 08:50:43 +12:00
|
|
|
|
2020-01-22 21:55:22 +13:00
|
|
|
EXPOSE 6600 6680 1704 1705 5555/udp
|
2019-04-20 08:50:43 +12:00
|
|
|
|
2020-01-22 21:55:22 +13:00
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "/entrypoint.sh"]
|
2021-03-27 17:47:55 +01:00
|
|
|
CMD ["mopidy"]
|