Create Dockerfile.debian
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 3 Nov 2020 11:38:14 +0000 (12:38 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 3 Nov 2020 11:38:14 +0000 (12:38 +0100)
Dockerfile.debian [new file with mode: 0644]

diff --git a/Dockerfile.debian b/Dockerfile.debian
new file mode 100644 (file)
index 0000000..337a0aa
--- /dev/null
@@ -0,0 +1,37 @@
+FROM python:3.8-slim
+
+ARG JEMALLOC_VERSION=5.2.1
+WORKDIR /usr/src/
+COPY . .
+
+ENV RUNTIME_DEPS="tzdata ca-certificates flac sox libsox-fmt-all ffmpeg libsndfile1 libtag1v5"
+ENV BUILD_DEPS="git curl build-essential libtag1-dev libffi-dev"
+
+RUN set -x \
+    # Install packages
+    && apt-get update && apt-get install -y --no-install-recommends \
+        # required packages
+        $RUNTIME_DEPS \
+        # (temp) build packages
+        $BUILD_DEPS \
+    # setup jmalloc
+    && curl -L -s https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2 | tar -xjf - -C /usr/src \
+        && cd /usr/src/jemalloc-${JEMALLOC_VERSION} \
+        && ./configure \
+        && make \
+        && make install \
+        && cd /usr/src \
+    # make sure uvloop is installed
+    &&  pip install uvloop \
+    # install music assistant
+    && python3 setup.py install \
+    # cleanup build files
+    && apt-get remove --purge -y --allow-remove-essential $BUILD_DEPS \
+    && rm -rf /var/lib/apt/lists/*
+
+
+ENV DEBUG=false
+VOLUME [ "/data" ]
+
+ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so
+ENTRYPOINT ["mass", "--config", "/data"]
\ No newline at end of file