From b52d4a508046938bf665c443fe7d27b58cd83b9b Mon Sep 17 00:00:00 2001 From: Tord-Vincent Heggland Date: Wed, 8 Apr 2026 09:50:09 +0200 Subject: [PATCH] entrypoint --- Dockerfile | 5 +++++ docker-compose.yaml | 2 +- entrypoint.sh | 10 ++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 823f1ff..ce6db04 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,3 +3,8 @@ FROM debian:bookworm-slim RUN apt-get update && \ apt-get install -y squeezelite libasound2 alsa-utils && \ rm -rf /var/lib/apt/lists/* + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 06fbcfa..1aabd0d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,5 +9,5 @@ services: volumes: - /etc/asound.conf:/etc/asound.conf:ro - /var/lib/alsa:/var/lib/alsa - entrypoint: ["/usr/bin/squeezelite"] command: ["-n", "ThinkBook DAC", "-o", "hw:1,0", "-s", "10.10.10.1", "-d", "all=info"] + init: true diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..02c7073 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +echo "Starting squeezelite..." + +while true; do + /usr/bin/squeezelite "$@" + echo "squeezelite stopped. Restarting in 1s..." + sleep 1 +done