-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 \
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 \
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
+++ /dev/null
-#!/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
+++ /dev/null
-#!/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