commit 55113f9f52036aecabb74750276c7035faa472fd Author: Djeeberjr Date: Sun Feb 6 00:52:44 2022 +0100 initial commit diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e31a6a6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,15 @@ +kind: pipeline +type: docker +name: default + +steps: +- name: docker + image: plugins/docker + settings: + repo: djeeberjr/spotifyd + username: djeeberjr + password: + from_secret: DOCKER_HUB_TOKEN +trigger: + branch: + - master diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6308d82 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM rust as build + +WORKDIR /build + +RUN apt-get -yqq update && \ + apt-get install --no-install-recommends -yqq libasound2-dev && \ + git clone --branch=master https://github.com/Spotifyd/spotifyd.git . + +RUN cargo build --release --features alsa_backend + +FROM debian:bullseye-slim + +RUN apt-get update && \ + apt-get install -yqq --no-install-recommends libasound2 && \ + rm -rf /var/lib/apt/lists/* && \ + groupadd -r spotify && \ + useradd --no-log-init -r -g spotify -G audio spotify + +USER spotify + +COPY --from=build /build/target/release/spotifyd /spotifyd +COPY start.sh /start.sh + +WORKDIR / + +ENTRYPOINT [ "/start.sh" ] diff --git a/README.md b/README.md new file mode 100644 index 0000000..93bdf33 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# Spotifyd docker + +Run [spotifyd](https://github.com/Spotifyd/spotifyd) inside docker. Inspired by [GnaphronG/docker-spotifyd](https://github.com/GnaphronG/docker-spotifyd). + +# Setup + +You need to add the `/dev/snd` to the container. Because the container uses Alsa you can have only one application use the device. If you have a something else runnig on your system that uses Alsa, you will get an error. + +Check out the `docker-compose.yml` for an example. + +# Configuration + +Following variables are available. + +`SPOTIFYD_USERNAME` Required. Spotify username. + +`SPOTIFYD_PASSWORD` Required. Spotify password. + +`SPOTIFYD_DEVICE` Name of the device. + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a14ccf7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: "3" + +services: + spotifyd: + container_name: spotify + image: djeeberjr/spotifyd + build: . + devices: + - "/dev/snd:/dev/snd" + environment: + - SPOTIFYD_USERNAME=myUsername + - SPOTIFYD_PASSWORD=myPassword + - SPOTIFYD_DEVICE=Spotifyd \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..c054946 --- /dev/null +++ b/start.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +./spotifyd --no-daemon --username "$SPOTIFYD_USERNAME" --password "$SPOTIFYD_PASSWORD" --device-name "$SPOTIFYD_DEVICE" +