home-assistant-addons/snapcast/Dockerfile

53 lines
1.3 KiB
Docker

ARG BUILD_FROM
#FROM rust:alpine as librespot-builder
#
#RUN apk add git build-base \
# && git clone https://github.com/librespot-org/librespot.git /librespot \
# && cd /librespot \
# && cargo build --release --no-default-features
FROM $BUILD_FROM
ARG BUILD_ARCH
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && \
apk add \
gst-plugins-good \
gst-plugins-bad \
mopidy \
nginx \
py3-pip \
snapcast-server \
supervisor && \
python3 -m pip install --break-system-packages Mopidy-Mobile && \
echo "daemon off;" >> /etc/nginx/nginx.conf
#COPY --from=librespot-builder /librespot/target/release/librespot /usr/bin/librespot
ADD --chmod=755 https://s3.serguzim.me/public/librespot/librespot-${BUILD_ARCH} /usr/bin/librespot
COPY data/supervisord.conf /etc/supervisord.conf
COPY data/snapserver.conf /etc/snapserver.conf
COPY data/config.js /usr/share/snapserver/snapweb/config.js
COPY data/mopidy-extra.conf /etc/mopidy/extra.conf
COPY data/Radios.m3u8.gtpl /templates/Radios.m3u8.gtpl
COPY data/nginx-site.gtpl /templates/nginx-site.gtpl
COPY data/run.sh /run.sh
RUN chmod a+x /run.sh
EXPOSE 1704 1705 6680
ENV LIBRESPOT_BACKEND=pipe
ENV LIBRESPOT_DEVICE=/tmp/snapfifo_librespot
ENV LIBRESPOT_NAME=Snapcast
ENV LIBRESPOT_AUTOPLAY=on
ENV LIBRESPOT_VOLUME=100
ENV RUST_LOG=DEBUG
CMD [ "/run.sh" ]