Add pictures for documentation and snapserver config

This commit is contained in:
Burningstone91
2021-01-01 17:22:59 +01:00
parent 5f97f97020
commit fc7849da1e
17 changed files with 53 additions and 1 deletions

31
snapserver/dockerfile Executable file
View File

@@ -0,0 +1,31 @@
FROM rust:1.45 AS librespot
RUN apt-get update \
&& apt-get -y install build-essential portaudio19-dev curl unzip \
&& apt-get clean && rm -fR /var/lib/apt/lists
ARG ARCH=amd64
ARG LIBRESPOT_VERSION=0.1.3
COPY ./install-librespot.sh /tmp/
RUN /tmp/install-librespot.sh
FROM debian:bullseye
ARG SNAPCASTVERSION=0.21.0
ARG SNAPCAST_FILE="0.21.0-1"
RUN apt-get update \
&& apt-get install wget -y \
&& wget 'https://github.com/badaix/snapcast/releases/download/v'$SNAPCASTVERSION'/snapserver_'$SNAPCAST_FILE'_amd64.deb' \
&& dpkg -i --force-all 'snapserver_'$SNAPCAST_FILE'_amd64.deb' \
&& apt-get -f install -y \
&& apt-get clean && rm -fR /var/lib/apt/lists
COPY --from=librespot /usr/local/cargo/bin/librespot /usr/local/bin/
COPY run.sh /
CMD ["/run.sh"]
ENV DEVICE_NAME=Snapcast
EXPOSE 1704/tcp 1705/tcp

View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -euo pipefail
if [[ "$ARCH" == "armhf" ]]; then
rust_bin_path="$(stat --format %n /usr/local/rustup/toolchains/*-armv7-unknown-linux-gnueabihf/bin)"
export PATH=${rust_bin_path}:$PATH
fi
exec cargo install librespot --version "${LIBRESPOT_VERSION}"

11
snapserver/run.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
credentials=""
if [[ -n "${USERNAME:-}" ]] && [[ -n "${PASSWORD:-}" ]]; then
credentials="\&username=$USERNAME\&password=$PASSWORD"
fi
#sed "/'\[stream\]'/a 'source = librespot:///librespot?name=Spotify\&devicename=$DEVICE_NAME\&bitrate=320\&volume=100$credentials'" /etc/snapserver.conf
exec snapserver