diff --git a/Dockerfile b/Dockerfile index 8fa94bc1f..2d2412bd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,13 +18,11 @@ ADD dist dist COPY requirements_all.txt . RUN uv pip install \ --no-cache \ - --find-links "https://wheels.home-assistant.io/musllinux/" \ -r requirements_all.txt # Install Music Assistant from prebuilt wheel RUN uv pip install \ --no-cache \ - --find-links "https://wheels.home-assistant.io/musllinux/" \ "music-assistant@dist/music_assistant-${MASS_VERSION}-py3-none-any.whl" # Set some labels diff --git a/Dockerfile.base b/Dockerfile.base index 5aa8d1dfb..45339538c 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -2,28 +2,35 @@ # BASE docker image for music assistant container -FROM python:3.12-alpine3.20 +FROM python:3.13-bookworm ARG TARGETPLATFORM + RUN set -x \ - && apk add --no-cache \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ ca-certificates \ - jemalloc \ curl \ git \ wget \ tzdata \ + libsox-fmt-all \ + libsox3 \ + ffmpeg \ sox \ + openssl \ cifs-utils \ - # install ffmpeg from community repo - && apk add --no-cache ffmpeg --repository=https://dl-cdn.alpinelinux.org/alpine/v3.20/community \ - # install snapcast from community repo - && apk add --no-cache snapcast --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ - # install libnfs from community repo - && apk add --no-cache libnfs --repository=https://dl-cdn.alpinelinux.org/alpine/v3.20/community \ - # install openssl-dev (needed for airplay) - && apk add --no-cache openssl-dev + libnfs-utils \ + libjemalloc2 \ + # install snapcast server 0.28 from bookworm backports + && bash -c 'echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/sources.list' \ + && apt-get update \ + && apt-get install -y --no-install-recommends -t bookworm-backports snapserver \ + # cleanup + && rm -rf /tmp/* \ + && rm -rf /var/lib/apt/lists/* + # Copy widevine client files to container RUN mkdir -p /usr/local/bin/widevine_cdm @@ -31,13 +38,15 @@ COPY widevine_cdm/* /usr/local/bin/widevine_cdm/ WORKDIR /app -# Configure runtime environmental variables -ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2" -ENV VIRTUAL_ENV=/app/venv +# Enable jemalloc +RUN \ + export LD_PRELOAD="$(find /usr/lib/ -name *libjemalloc.so.2)" \ + export MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" # create python venv -RUN python3 -m venv $VIRTUAL_ENV && \ - source $VIRTUAL_ENV/bin/activate && \ +ENV VIRTUAL_ENV=/app/venv +RUN python -m venv $VIRTUAL_ENV && \ + bash -c 'source $VIRTUAL_ENV/bin/activate' && \ pip install --upgrade pip \ && pip install uv==0.4.17