-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
118 lines (102 loc) · 3.33 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
108
109
110
111
112
113
114
115
116
117
118
FROM ubuntu:18.04
LABEL maintainer "Josh Sunnex <[email protected]>"
###############################################################
#
# Configure
#
###############################################################
# Version of Tizonia to be installed
ARG TIZONIA_VERSION=0.21.0-1
# Configure username for executing process
ENV UNAME tizonia
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# A list of dependencies installed with
ARG PYTHON_DEPENDENCIES=" \
eventlet>=0.25.1 \
fuzzywuzzy>=0.17.0 \
gmusicapi>=12.1.1 \
joblib>=0.14.1\
pafy>=0.5.4 \
plexapi>=3.0.0 \
pychromecast>=4.1.1 \
pycountry>=19.8.18 \
python-levenshtein>=0.12.0 \
soundcloud>=0.5.0 \
spotipy>=2.4.4 \
titlecase>=0.12.0 \
youtube-dl>=2020.05.29 \
"
# Build Dependencies (not required in final image)
ARG BUILD_DEPENDENCIES=" \
build-essential \
curl \
gnupg \
libffi-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
python3-dev \
python3-pip \
python3-pkg-resources \
python3-setuptools \
python3-wheel \
"
###############################################################
# Exec build step
RUN \
echo "**** Update sources ****" \
&& apt-get update \
&& \
echo "**** Install package build tools ****" \
&& apt-get install -y --no-install-recommends \
${BUILD_DEPENDENCIES} \
locales \
&& \
echo "**** Generate necessary locales ****" \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen \
&& \
echo "**** Add additional apt repos ****" \
&& curl -ksSL 'http://apt.mopidy.com/mopidy.gpg' | apt-key add - \
&& echo "deb http://apt.mopidy.com/ stretch main contrib non-free" > /etc/apt/sources.list.d/libspotify.list \
&& curl -ksSL 'https://bintray.com/user/downloadSubjectPublicKey?username=tizonia' | apt-key add - \
&& echo "deb https://dl.bintray.com/tizonia/ubuntu bionic main" > /etc/apt/sources.list.d/tizonia.list \
&& apt-get update \
&& \
echo "**** Install python dependencies ****" \
&& python3 -m pip install --no-cache-dir --upgrade ${PYTHON_DEPENDENCIES} \
&& \
echo "**** Install tizonia ****" \
&& apt-get install -y \
python3-distutils \
pulseaudio-utils \
libspotify12 \
tizonia-all=${TIZONIA_VERSION} \
&& \
echo "**** create ${UNAME} user and make our folders ****" \
&& mkdir -p \
/home/${UNAME} \
&& groupmod -g 1000 users \
&& useradd -u 1000 -U -d /home/${UNAME} -s /bin/false ${UNAME} \
&& usermod -G users ${UNAME} \
&& \
echo "**** Cleanup ****" \
&& apt-get purge -y --auto-remove \
${BUILD_DEPENDENCIES} \
&& apt-get clean \
&& rm -rf \
/tmp/* \
/var/tmp/* \
/var/lib/apt/lists/* \
/etc/apt/sources.list.d/* \
&& \
echo
# Copy run script
COPY run.sh /run.sh
# Run Tizonia as non privileged user
USER ${UNAME}
ENV HOME=/home/${UNAME}
WORKDIR ${HOME}
ENTRYPOINT [ "/run.sh" ]