diff --git a/Dockerfile b/Dockerfile index 8e77f6d..87554db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN mkdir -p /bin/ /config/ /data/ && \ apk add mpd navidrome nginx COPY ./bin/. /usr/local/bin/ -COPY ./config/. /config/ +COPY ./config/. /etc/ COPY ./data/. /data/ FROM scratch diff --git a/bin/entrypoint-music.sh b/bin/entrypoint-music.sh index 7b25b1a..9462fb9 100755 --- a/bin/entrypoint-music.sh +++ b/bin/entrypoint-music.sh @@ -98,6 +98,19 @@ if [ ! -L "/etc/nginx/http.d/default.conf" ]; then ln -sf "/config/nginx/navidrome.conf" "/etc/nginx/http.d/default.conf" fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +[ -d "/data/mpd" ] || mkdir -p "/data/mpd" +[ -d "/data/music" ] || mkdir -p "/data/music" +[ -d "/data/navidrome" ] || mkdir -p "/data/navidrome" +[ -d "/data/playlists" ] || mkdir -p "/data/playlists" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +[ -d "/config/mpd" ] || mkdir -p "/config/mpd" +[ -d "/config/nginx" ] || mkdir -p "/config/nginx" +[ -d "/config/navidrome" ] || mkdir -p "/navidrome/mpd" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +[ -f "/config/mpd/mpd.conf" ] || cp -Rf "/etc/mpd.conf" "/config/mpd/mpd.conf" +[ -f "/config/nginx/navidrome.conf" ] || cp -Rf "/etc/nginx/navidrome.conf" "/config/navidrome.conf" +[ -f "/config/navidrome/navidrome.toml" ] || cp -Rf "/etc/navidrome/navidrome.toml" "/config/navidrome/navidrome.toml" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if ! pgrep mpd &>/dev/null; then [ -f "/data/mpd/mpd.pid" ] && rm -Rf "/data/mpd/mpd.pid" fi diff --git a/data/mpd/.gitkeep b/data/mpd/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/data/music/.gitkeep b/data/music/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/data/navidrome/.gitkeep b/data/navidrome/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/data/playlists/.gitkeep b/data/playlists/.gitkeep deleted file mode 100644 index e69de29..0000000