diff --git a/Dockerfile b/Dockerfile index 87554db..2bc1618 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM casjaysdevdocker/alpine:latest as build +ARG alpine_version=edge + ARG LICENSE=WTFPL \ IMAGE_NAME=music \ TIMEZONE=America/New_York \ @@ -12,11 +14,11 @@ ENV SHELL=/bin/bash \ RUN mkdir -p /bin/ /config/ /data/ && \ rm -Rf /bin/.gitkeep /config/.gitkeep /config/*/.gitkeep /data/.gitkeep /data/*/.gitkeep /etc/apk/repositories && \ - echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \ - echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ - echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \ + echo "http://dl-cdn.alpinelinux.org/alpine/$alpine_version/main" >> /etc/apk/repositories && \ + 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 mpd navidrome nginx + apk add --no-cache mpd navidrome COPY ./bin/. /usr/local/bin/ COPY ./config/. /etc/ diff --git a/bin/entrypoint-music.sh b/bin/entrypoint-music.sh index 21a186a..d66c38c 100755 --- a/bin/entrypoint-music.sh +++ b/bin/entrypoint-music.sh @@ -101,17 +101,11 @@ fi [ -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 "/config/navidrome" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ -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 [ ! -L "/etc/nginx/http.d/default.conf" ] && [ -f "/config/nginx/navidrome.conf" ]; then - ln -sf "/config/nginx/navidrome.conf" "/etc/nginx/http.d/default.conf" -fi -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if ! pgrep mpd &>/dev/null; then [ -f "/data/mpd/mpd.pid" ] && rm -Rf "/data/mpd/mpd.pid" fi @@ -142,7 +136,6 @@ healthcheck) # Docker healthcheck *) # Execute primary command if [ $# -eq 0 ]; then - nginx mpd "/config/mpd/mpd.conf" navidrome --configfile "/config/navidrome/navidrome.toml" else diff --git a/config/navidrome/navidrome.toml b/config/navidrome/navidrome.toml index e8d946f..3930935 100644 --- a/config/navidrome/navidrome.toml +++ b/config/navidrome/navidrome.toml @@ -2,9 +2,9 @@ MusicFolder = "/data/music" PlaylistsPath = "/data/playlists:**/**" DataFolder = "/data/navidrome" ScanSchedule = "@every 360m" -BaseUrl = "/" -Address = "127.0.0.1" -Port = 4533 +BaseUrl = "" +Address = "0.0.0.0" +Port = 80 EnableTranscodingConfig = true TranscodingCacheSize = "500MB" ImageCacheSize = "100MB" diff --git a/config/nginx/navidrome.conf b/config/nginx/navidrome.conf deleted file mode 100644 index e071fcc..0000000 --- a/config/nginx/navidrome.conf +++ /dev/null @@ -1,16 +0,0 @@ -server { - listen 80 default_server; - listen [::]:80 default_server; - - location / { - # replace local-address with your navidrome server's IP - proxy_pass http://127.0.0.1:4533/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Protocol $scheme; - proxy_set_header X-Forwarded-Host $http_host; - proxy_buffering off; - } -}