forked from wernight/docker-mopidy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
68 lines (58 loc) · 2.17 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
FROM debian:jessie
# Default configuration
COPY mopidy.conf /var/lib/mopidy/.config/mopidy/mopidy.conf
# Start helper script
COPY entrypoint.sh /entrypoint.sh
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
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 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
gcc \
gstreamer0.10-alsa \
gstreamer0.10-plugins-bad \
gstreamer1.0-libav \
gstreamer1.0-plugins-bad \
python-crypto \
&& curl -L https://apt.mopidy.com/mopidy.gpg -o /tmp/mopidy.gpg \
&& curl -L https://apt.mopidy.com/mopidy.list -o /etc/apt/sources.list.d/mopidy.list \
&& apt-key add /tmp/mopidy.gpg \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
mopidy \
mopidy-soundcloud \
mopidy-spotify \
&& curl -L https://bootstrap.pypa.io/get-pip.py | python - \
&& pip install -U six \
&& pip install \
Mopidy-Moped \
Mopidy-GMusic \
Mopidy-YouTube \
pyasn1==0.1.8 \
# Install dumb-init
# https://github.com/Yelp/dumb-init
&& DUMP_INIT_URI=$(curl -L https://github.com/Yelp/dumb-init/releases/latest | grep -Po '(?<=href=")[^"]+_amd64(?=")') \
&& curl -Lo /usr/local/bin/dumb-init "https://github.com/$DUMP_INIT_URI" \
&& chmod +x /usr/local/bin/dumb-init \
# Clean-up
&& apt-get purge --auto-remove -y \
curl \
gcc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache \
# Limited access rights.
&& chown mopidy:audio -R /var/lib/mopidy/.config \
&& chown mopidy:audio /entrypoint.sh
# Run as mopidy user
USER mopidy
VOLUME ["/var/lib/mopidy/local", "/var/lib/mopidy/media"]
EXPOSE 6600 6680
ENTRYPOINT ["/usr/local/bin/dumb-init", "/entrypoint.sh"]
CMD ["/usr/bin/mopidy"]