forked from wernight/docker-mopidy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
80 lines (67 loc) · 2.34 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM lsiobase/ubuntu:bionic
ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex \
# Official Mopidy install for Debian/Ubuntu along with some extensions
# (see https://docs.mopidy.com/en/latest/installation/debian/ )
&& apt-get update \
&& apt-get install -y \
curl \
software-properties-common \
dumb-init \
gcc \
gnupg \
gstreamer1.0-alsa \
gstreamer1.0-plugins-bad \
apt-transport-https \
ca-certificates \
python3-crypto \
python3-pykka \
&& add-apt-repository ppa:deadsnakes/ppa \
&& curl -L https://apt.mopidy.com/mopidy.gpg | apt-key add - \
&& curl -L https://apt.mopidy.com/mopidy.list -o /etc/apt/sources.list.d/mopidy.list \
&& apt-get update -y && apt-get install -y python3.7 python3-pip && rm /usr/bin/python3 && ln -s python3.7 /usr/bin/python3
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
mopidy \
mopidy-soundcloud \
mopidy-spotify \
&& curl -L https://bootstrap.pypa.io/get-pip.py | python - \
&& pip3 install -U six pyasn1 requests[security] cryptography \
&& pip3 install \
Mopidy-Jellyfin \
Mopidy-Iris \
Mopidy-Moped \
Mopidy-GMusic \
Mopidy-Pandora \
Mopidy-YouTube \
pyopenssl \
youtube-dl \
&& mkdir -p /var/lib/mopidy/.config \
&& ln -s /config /var/lib/mopidy/.config/mopidy \
# Clean-up
&& apt-get purge --auto-remove -y \
curl \
gcc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache
# Start helper script.
COPY entrypoint.sh /entrypoint.sh
# Default configuration.
COPY mopidy.conf /config/mopidy.conf
# Copy the Jellyfin configuraion.
COPY jellyfin.conf /config/jellyfin.conf
# Copy the pulse-client configuration.
COPY pulse-client.conf /etc/pulse/client.conf
# Allows any user to run mopidy, but runs by default as a randomly generated UID/GID.
ENV HOME=/var/lib/mopidy
RUN set -ex \
&& usermod -G audio,sudo mopidy \
&& chown mopidy:audio -R $HOME /entrypoint.sh \
&& chmod go+rwx -R $HOME /entrypoint.sh
# Runs as mopidy user by default.
USER mopidy
VOLUME ["/var/lib/mopidy/local", "/var/lib/mopidy/media"]
EXPOSE 6600 6680 5555/udp
ENTRYPOINT ["/usr/bin/dumb-init", "/entrypoint.sh"]
CMD ["/usr/bin/mopidy"]