env:
PYTHON_VERSION: "3.12"
BASE_IMAGE_VERSION_STABLE: "1.3.1"
- BASE_IMAGE_VERSION_BETA: "1.4.4"
- BASE_IMAGE_VERSION_NIGHTLY: "1.4.4"
+ BASE_IMAGE_VERSION_BETA: "1.4.5"
+ BASE_IMAGE_VERSION_NIGHTLY: "1.4.5"
jobs:
preflight-checks:
# ensure UV is installed
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
+# Install build tools for PyAV compilation (for aioresonate)
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ gcc \
+ g++ \
+ python3-dev \
+ && rm -rf /var/lib/apt/lists/*
+
# create venv which will be copied to the final image
ENV VIRTUAL_ENV=/app/venv
RUN uv venv $VIRTUAL_ENV
RUN uv pip install \
-r requirements_all.txt
+# Reinstall PyAV from source to use system FFmpeg instead of bundled FFmpeg
+# Use the version already resolved by requirements_all.txt to ensure compatibility
+RUN uv pip install --no-binary av --force-reinstall --no-deps \
+ "av==$($VIRTUAL_ENV/bin/python -c 'import importlib.metadata; print(importlib.metadata.version("av"))')"
+
# Install Music Assistant from prebuilt wheel
ARG MASS_VERSION
RUN uv pip install \
libflac12 \
libavahi-client3 \
libavahi-common3 \
+ # pkg-config needed for PyAV (for aioresonate) to find system FFmpeg
+ pkg-config \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=ffmpeg-builder /usr/local/lib/libsw*.so* /usr/local/lib/
COPY --from=ffmpeg-builder /usr/local/lib/libpostproc.so* /usr/local/lib/
+# Copy FFmpeg headers and pkg-config files needed for PyAV compilation (adds around 2 MB)
+COPY --from=ffmpeg-builder /usr/local/include/ /usr/local/include/
+COPY --from=ffmpeg-builder /usr/local/lib/pkgconfig/ /usr/local/lib/pkgconfig/
+
+# Set PKG_CONFIG_PATH so pkg-config can find FFmpeg
+ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+
# Update shared library cache and verify FFmpeg
RUN ldconfig && ffmpeg -version && ffprobe -version