mirror of
https://github.com/Burningstone91/smart-home-setup.git
synced 2022-05-05 21:16:50 +03:00
Add pictures for documentation and snapserver config
This commit is contained in:
31
snapserver/dockerfile
Executable file
31
snapserver/dockerfile
Executable 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
|
||||
9
snapserver/install-librespot.sh
Executable file
9
snapserver/install-librespot.sh
Executable 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
11
snapserver/run.sh
Executable 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
|
||||
Reference in New Issue
Block a user