forked from makingwilliam/hassio-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·107 lines (100 loc) · 3.26 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
ARG BUILD_FROM=hassioaddons/debian-base:3.1.0
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Copy Python requirements file
COPY requirements.txt /tmp/
# Setup base
RUN \
apt-get update \
\
&& apt-get install -y --no-install-recommends \
dirmngr \
gpg-agent \
gpg \
libnginx-mod-http-lua \
luarocks \
nginx \
git \
\
&& 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 \
\
&& apt-get install -y --no-install-recommends \
libffi-dev \
libxml2-dev \
libxslt1-dev \
libasound2-dev \
libspotify12 \
libspotify-dev \
zlib1g-dev \
build-essential \
python3-dev \
python3-gi \
python3-gst-1.0 \
gstreamer1.0-alsa \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-pulseaudio \
\
&& luarocks install lua-resty-http 0.15-0 \
\
&& curl https://bootstrap.pypa.io/get-pip.py | python3 \
&& pip3 install --no-cache-dir -r /tmp/requirements.txt \
&& echo "mopidy ALL=NOPASSWD: /usr/local/lib/python3.7/dist-packages/mopidy_iris/system.sh" >> /etc/sudoers \
\
&& find /usr/local/lib/python3.7/ -type d -name tests -depth -exec rm -rf {} \; \
&& find /usr/local/lib/python3.7/ -type d -name test -depth -exec rm -rf {} \; \
&& find /usr/local/lib/python3.7/ -name __pycache__ -depth -exec rm -rf {} \; \
&& find /usr/local/lib/python3.7/ -name "*.pyc" -depth -exec rm -f {} \; \
\
&& apt-get purge -y --auto-remove \
dirmngr \
gpg-agent \
gpg \
git \
libffi-dev \
libxml2-dev \
libxslt1-dev \
zlib1g-dev \
build-essential \
gcc \
python-dev \
dpkg-dev \
gcc-7 \
luarocks \
&& rm -fr \
/var/{cache,log}/* \
/var/lib/apt/lists/* \
/root/.cache \
&& find /tmp/ -mindepth 1 -delete
# Move access.log to stdout and error.log to stderr
RUN mkdir -p /var/log/nginx && ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
# Copy root filesystem
COPY rootfs /
# Build arguments
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_REF
ARG BUILD_VERSION
# Labels
LABEL \
io.hass.name="Mopidy" \
io.hass.description="Mopidy is an extensible music server" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="Bram Mittendorff, Franck Nijhof, Robbert Müller" \
org.label-schema.description="Mopidy is an extensible music server" \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="Mopidy" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://community.home-assistant.io/" \
org.label-schema.usage="https://github.com/hassio-addons/addon-mopidy/tree/master/README.md" \
org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-url="https://github.com/hassio-addons/addon-mopidy" \
org.label-schema.vendor="Home Assistant Community Add-ons"