ARG BUILD_FROM=docker.io/arm32v7/debian:bookworm-slim

FROM $BUILD_FROM

RUN apt-get update \
 && apt-get install -y wget \
                       gstreamer1.0-alsa \
                       gstreamer1.0-plugins-good \
                       gstreamer1.0-plugins-ugly \
                       gstreamer1.0-plugins-bad \
                       python3-gst-1.0 \
                       python3-lxml \
                       python3-pip \
                       python3-setuptools \
                       python3-wheel \
                       libasound2-dev \
 && rm -rf /var/lib/apt/lists/*

COPY requirements.txt requirements.txt

RUN pip3 install --break-system-packages -r requirements.txt \
 && rm -rf ~/.cache/pip

RUN update-ca-certificates --fresh

RUN mkdir /root/music

VOLUME ["/root/.cache/mopidy", "/root/.local/share/mopidy", "/root/music"]

ENV TZ=Europe/Vienna

EXPOSE 6600 6680

ENTRYPOINT ["mopidy"]