diff --git a/Dockerfile b/Dockerfile index 665c3f3..12832c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN mkdir -p /bin/ /config/ /data/ && \ echo "http://dl-cdn.alpinelinux.org/alpine/$alpine_version/community" >> /etc/apk/repositories && \ echo "http://dl-cdn.alpinelinux.org/alpine/$alpine_version/testing" >> /etc/apk/repositories && \ apk update -U --no-cache && \ - apk add --no-cache mpd navidrome + apk add --no-cache mpd mpc navidrome COPY ./bin/. /usr/local/bin/ COPY ./config/. /etc/ diff --git a/bin/entrypoint-music.sh b/bin/entrypoint-music.sh index 0e09790..96f7b50 100755 --- a/bin/entrypoint-music.sh +++ b/bin/entrypoint-music.sh @@ -47,6 +47,14 @@ __exec_bash() { return ${exitCode:-$?} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +__mpd_start() { + sleep 10 + mpd /config/mpd/mpd.conf + sleep 5 + if pgrep mpd &>/dev/null && mpc status | grep -qv 'playing'; then + mpc play &>/dev/null + fi +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Define default variables TZ="${TZ:-America/New_York}" HOSTNAME="${HOSTNAME:-casjaysdev-bin}" @@ -137,7 +145,7 @@ healthcheck) # Docker healthcheck *) # Execute primary command if [ $# -eq 0 ]; then - mpd "/config/mpd/mpd.conf" + __mpd_start & navidrome --configfile "/config/navidrome/navidrome.toml" else __exec_bash "$@" diff --git a/config/mpd/mpd.conf b/config/mpd/mpd.conf index 2fe59c2..5610c0d 100644 --- a/config/mpd/mpd.conf +++ b/config/mpd/mpd.conf @@ -22,22 +22,21 @@ zeroconf_name "mpd server" # Character Encoding ########################################################## filesystem_charset "UTF-8" # Output ####################################################################### -audio_output { - type "httpd" - name "stream" - encoder "lame" - port "8000" - bind_to_address "0.0.0.0" - bitrate "128000" - format "48000:16:1" - always_on "yes" - tags "yes" - max_clients "0" -} audio_output { type "null" name "This server does not need to play music, but it can" } +audio_output { + type "httpd" + name "stream" + encoder "lame" + port "8000" + bitrate "128" + max_clients "0" + mixer_type "software" + format "44100:16:2" + always_on "yes" +} # Input ####################################################################### input { plugin "curl"