fix alpine build
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 3 Nov 2020 07:58:32 +0000 (08:58 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 3 Nov 2020 07:58:32 +0000 (08:58 +0100)
.dockerignore [new file with mode: 0644]
Dockerfile
requirements.txt
rootfs/etc/services.d/music_assistant/finish [deleted file]
rootfs/etc/services.d/music_assistant/run [deleted file]

diff --git a/.dockerignore b/.dockerignore
new file mode 100644 (file)
index 0000000..029ac7c
--- /dev/null
@@ -0,0 +1,8 @@
+.github
+.mypy_cache
+.tox
+.git
+build
+dist
+venv
+**/__pycache__
\ No newline at end of file
index c866223e9930c7a14a04ceb8944b5194c33706f0..f65e6c9b26af262b4676821fcd07aead9a464719 100755 (executable)
@@ -1,8 +1,4 @@
-FROM python:3.8-alpine3.12
-
-# Versions
-ARG JEMALLOC_VERSION=5.2.1
-ARG MASS_VERSION=0.0.62
+FROM alpine:3.12
 
 # Install packages
 RUN set -x \
@@ -14,18 +10,25 @@ RUN set -x \
         tzdata \
         ca-certificates \
         curl \
-        bind-tools \
         flac \
         sox \
+        libuv \
         ffmpeg \
-        libsndfile \
-        taglib \
-        openblas \
-        libgfortran \
-        lapack \
+        python3 \
+        py3-pillow \
+        py3-numpy \
+        py3-scipy \
+        py3-aiohttp \
+        py3-jwt \
+        py3-passlib \
+        py3-cryptography \
+        py3-zeroconf \
+        py3-pytaglib \
+        py3-pip \
     # build packages
     && apk add --no-cache --virtual .build-deps \
         build-base \
+        python3-dev \
         libsndfile-dev \
         taglib-dev \
         openblas-dev \
@@ -44,28 +47,32 @@ RUN set -x \
         tcl-dev \
         tiff-dev \
         tk-dev \
-        zlib-dev
+        zlib-dev \
+        libuv-dev
 
 # setup jmalloc
+ARG JEMALLOC_VERSION=5.2.1
 RUN curl -L -f -s "https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2" \
-        | tar -xjf - -C /usr/src \
+        | tar -xjf - -C /tmp/src \
     && cd /usr/src/jemalloc-${JEMALLOC_VERSION} \
     && ./configure \
     && make \
-    && make install \
-    && rm -rf /usr/src/jemalloc-${JEMALLOC_VERSION} \
-    # change workdir back to /tmp
-    && cd /tmp
+    && make install
 
 # install uvloop and music assistant
-RUN pip install --upgrade uvloop music-assistant==${MASS_VERSION}
+WORKDIR /usr/src/
+COPY . .
+RUN pip install --upgrade uvloop \
+    && python3 setup.py install
 
 # cleanup build files
 RUN apk del .build-deps \
     && rm -rf /usr/src/*
 
 ENV DEBUG=false
+EXPOSE 8095/tcp
+
 VOLUME [ "/data" ]
 
 ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so
-ENTRYPOINT ["python", "-m", "music_assistant", "--config", "/data"]
\ No newline at end of file
+ENTRYPOINT ["python3", "-m", "music_assistant", "--config", "/data"]
\ No newline at end of file
index a3e4e74c304a1e848e76b147d3d12528c042fb88..8b60d598b7573ad4c7758d90f50678d397b5d963 100644 (file)
@@ -1,23 +1,23 @@
 argparse==1.4.0
-aiohttp[speedups]==3.7.2
+aiohttp[speedups]~=3.7.2
 pychromecast==7.5.1
 asyncio-throttle==1.0.1
 aiofile==3.1.0
 aiosqlite==0.16.0
-pytaglib==1.4.6
+pytaglib~=1.4.6
 python-slugify==4.0.1
 memory-tempfile==2.2.3
 pyloudnorm==0.1.0
 SoundFile==0.10.3.post1
 aiorun==2020.11.1
 soco==0.20
-pillow==8.0.1
+pillow<=8.0.1
 aiohttp_cors==0.7.0
 unidecode==1.1.1
-PyJWT==1.7.1
+PyJWT~=1.7.1
 aiohttp_jwt==0.6.1
-zeroconf==0.28.6
-passlib==1.7.4
-cryptography==3.2
+zeroconf>=0.28.5
+passlib~=1.7.4
+cryptography>=2.9.2
 ujson==4.0.1
 mashumaro==1.13
diff --git a/rootfs/etc/services.d/music_assistant/finish b/rootfs/etc/services.d/music_assistant/finish
deleted file mode 100644 (file)
index 282679e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/execlineb -S0
-# ==============================================================================
-# Take down the S6 supervision tree when MusicAssistant fails
-# ==============================================================================
-if -n { s6-test $# -ne 0 }
-if -n { s6-test ${1} -eq 256 }
-
-s6-svscanctl -t /var/run/s6/services
\ No newline at end of file
diff --git a/rootfs/etc/services.d/music_assistant/run b/rootfs/etc/services.d/music_assistant/run
deleted file mode 100644 (file)
index f933252..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/with-contenv bash
-# ==============================================================================
-# Run MusicAssistant
-# ==============================================================================
-
-# Enable Jemalloc
-export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
-
-args="--config /data"
-
-if [ "$DEBUG" = true ] ; then
-    args="${args} --debug"
-fi
-
-exec python -m music_assistant ${args}
\ No newline at end of file