initial commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
# Install Mopidy from the official repo + GStreamer + plugins
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
curl gnupg ca-certificates \
|
||||
# Add Mopidy apt repo
|
||||
&& curl -1sLf 'https://dl.cloudsmith.io/public/mopidy/mopidy/setup.deb.sh' \
|
||||
| bash \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
mopidy \
|
||||
# GStreamer pipeline (needed for filesink output to FIFO)
|
||||
gstreamer1.0-plugins-good \
|
||||
gstreamer1.0-plugins-bad \
|
||||
gstreamer1.0-plugins-ugly \
|
||||
gstreamer1.0-tools \
|
||||
# Python / pip for Mopidy extensions
|
||||
python3-pip \
|
||||
python3-gst-1.0 \
|
||||
gettext-base \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Mopidy Python extensions
|
||||
# Add or remove plugins to suit your setup.
|
||||
RUN pip3 install --break-system-packages \
|
||||
mopidy-local \
|
||||
mopidy-mpd \
|
||||
mopidy-youtube \
|
||||
yt-dlp
|
||||
|
||||
# Mopidy runs as the mopidy user (created by the package)
|
||||
RUN mkdir -p /var/lib/mopidy /config \
|
||||
&& chown -R mopidy:audio /var/lib/mopidy /config
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 6680
|
||||
USER mopidy
|
||||
|
||||
HEALTHCHECK --interval=20s --timeout=5s --start-period=15s \
|
||||
CMD curl -sf http://localhost:6680/mopidy/rpc \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"core.get_version"}' \
|
||||
-H 'Content-Type: application/json' | grep -q '"id": 1' || exit 1
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["mopidy", "--config", "/tmp/mopidy.conf"]
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# Mopidy entrypoint
|
||||
# Ensures the audio FIFO exists (Snapserver must open it too, ordering matters)
|
||||
set -e
|
||||
|
||||
FIFO=/audio/mopidy.fifo
|
||||
|
||||
# Create FIFO if missing (init-pipes.sh should have done this, but be safe)
|
||||
if [[ ! -p "$FIFO" ]]; then
|
||||
echo "[mopidy] Creating FIFO: $FIFO"
|
||||
mkfifo "$FIFO"
|
||||
chmod 666 "$FIFO"
|
||||
fi
|
||||
|
||||
echo "[mopidy] FIFO ready: $FIFO"
|
||||
|
||||
# Expand only our own vars — leave Mopidy's $XDG_* vars untouched
|
||||
envsubst '${SPOTIFY_CLIENT_ID}${SPOTIFY_CLIENT_SECRET}${SNAPSERVER_HOST}${BEETS_HOST}' \
|
||||
< /config/mopidy.conf > /tmp/mopidy.conf
|
||||
echo "[mopidy] Config expanded from template"
|
||||
|
||||
exec "$@"
|
||||
@@ -0,0 +1,148 @@
|
||||
[core]
|
||||
cache_dir = $XDG_CACHE_DIR/mopidy
|
||||
config_dir = $XDG_CONFIG_DIR/mopidy
|
||||
data_dir = $XDG_DATA_DIR/mopidy
|
||||
max_tracklist_length = 10000
|
||||
restore_state = false
|
||||
|
||||
[logging]
|
||||
verbosity = 1
|
||||
format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
|
||||
color = true
|
||||
config_file =
|
||||
|
||||
[audio]
|
||||
mixer = software
|
||||
mixer_volume =
|
||||
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! tee name=t ! queue leaky=2 ! filesink location=/audio/mopidy.fifo t. ! queue leaky=2 ! filesink location=/audio/cava.fifo
|
||||
buffer_time =
|
||||
|
||||
[proxy]
|
||||
scheme =
|
||||
hostname =
|
||||
port =
|
||||
username =
|
||||
password =
|
||||
|
||||
[iris]
|
||||
enabled = true
|
||||
country = AT
|
||||
locale = en_NZ
|
||||
verify_certificates = true
|
||||
snapcast_enabled = true
|
||||
snapcast_host = ${SNAPSERVER_HOST}
|
||||
snapcast_port = 1780
|
||||
snapcast_ssl = false
|
||||
snapcast_stream = mopidy
|
||||
spotify_authorization_url = https://jamesbarnsley.co.nz/iris/auth_spotify.php
|
||||
lastfm_authorization_url = https://jamesbarnsley.co.nz/iris/auth_lastfm.php
|
||||
genius_authorization_url = https://jamesbarnsley.co.nz/iris/auth_genius.php
|
||||
data_dir = /data/iris
|
||||
|
||||
#[listenbrainz]
|
||||
#enabled = false ; Extension disabled by user config.
|
||||
|
||||
[local]
|
||||
enabled = true
|
||||
max_search_results = 500
|
||||
media_dir = /music
|
||||
scan_timeout = 1000
|
||||
scan_flush_threshold = 0
|
||||
scan_follow_symlinks = false
|
||||
included_file_extensions =
|
||||
excluded_file_extensions =
|
||||
.cue
|
||||
.directory
|
||||
.html
|
||||
.log
|
||||
.nfo
|
||||
.pdf
|
||||
.txt
|
||||
.zip
|
||||
directories =
|
||||
Albums local:directory?type=album
|
||||
Artists local:directory?type=artist
|
||||
Composers local:directory?type=artist&role=composer
|
||||
Genres local:directory?type=genre
|
||||
Performers local:directory?type=artist&role=performer
|
||||
Release Years local:directory?type=date&format=%25Y
|
||||
Tracks local:directory?type=track
|
||||
Last Week's Updates local:directory?max-age=604800
|
||||
Last Month's Updates local:directory?max-age=2592000
|
||||
timeout = 10
|
||||
use_artist_sortname = true
|
||||
album_art_files =
|
||||
folder.jpg
|
||||
cover.jpg
|
||||
*.jpg
|
||||
*.png
|
||||
|
||||
[file]
|
||||
enabled = true
|
||||
media_dirs =
|
||||
/music
|
||||
excluded_file_extensions =
|
||||
.directory
|
||||
.html
|
||||
.log
|
||||
.nfo
|
||||
.pdf
|
||||
.txt
|
||||
.zip
|
||||
show_dotfiles = false
|
||||
follow_symlinks = false
|
||||
metadata_timeout = 1000
|
||||
|
||||
[http]
|
||||
enabled = true
|
||||
hostname = 0.0.0.0
|
||||
port = 6680
|
||||
zeroconf = Mopidy HTTP server on $hostname
|
||||
allowed_origins =
|
||||
192.168.178.100
|
||||
localhost
|
||||
csrf_protection = false
|
||||
default_app = mopidy
|
||||
|
||||
[m3u]
|
||||
enabled = true
|
||||
base_dir = /music
|
||||
default_encoding = latin-1
|
||||
default_extension = .m3u8
|
||||
playlists_dir =
|
||||
|
||||
[softwaremixer]
|
||||
enabled = true
|
||||
|
||||
[stream]
|
||||
enabled = true
|
||||
protocols =
|
||||
http
|
||||
https
|
||||
mms
|
||||
rtmp
|
||||
rtmps
|
||||
rtsp
|
||||
metadata_blacklist =
|
||||
timeout = 5000
|
||||
|
||||
[mpd]
|
||||
enabled = true
|
||||
hostname = 0.0.0.0
|
||||
connection_timeout = 120
|
||||
|
||||
#[spotify]
|
||||
# mopidy-spotify requires pyspotify which has no arm64 build (libspotify was
|
||||
# discontinued by Spotify). Spotify playback is handled via librespot/snapserver.
|
||||
#client_id = ${SPOTIFY_CLIENT_ID}
|
||||
#client_secret = ${SPOTIFY_CLIENT_SECRET}
|
||||
|
||||
[muse]
|
||||
enabled = true
|
||||
|
||||
[youtube]
|
||||
enabled = true
|
||||
|
||||
[beets]
|
||||
hostname = ${BEETS_HOST}
|
||||
port = 8337
|
||||
@@ -0,0 +1,148 @@
|
||||
[core]
|
||||
cache_dir = $XDG_CACHE_DIR/mopidy
|
||||
config_dir = $XDG_CONFIG_DIR/mopidy
|
||||
data_dir = $XDG_DATA_DIR/mopidy
|
||||
max_tracklist_length = 10000
|
||||
restore_state = false
|
||||
|
||||
[logging]
|
||||
verbosity = 1
|
||||
format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
|
||||
color = true
|
||||
config_file =
|
||||
|
||||
[audio]
|
||||
mixer = software
|
||||
mixer_volume =
|
||||
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! filesink location=/tmp/snapfifo
|
||||
buffer_time =
|
||||
|
||||
[proxy]
|
||||
scheme =
|
||||
hostname =
|
||||
port =
|
||||
username =
|
||||
password =
|
||||
|
||||
[iris]
|
||||
enabled = true
|
||||
country = AT
|
||||
locale = en_NZ
|
||||
verify_certificates = true
|
||||
snapcast_enabled = true
|
||||
snapcast_host = 192.168.178.100
|
||||
snapcast_port = 1780
|
||||
snapcast_ssl = false
|
||||
snapcast_stream = mopidy
|
||||
spotify_authorization_url = https://jamesbarnsley.co.nz/iris/auth_spotify.php
|
||||
lastfm_authorization_url = https://jamesbarnsley.co.nz/iris/auth_lastfm.php
|
||||
genius_authorization_url = https://jamesbarnsley.co.nz/iris/auth_genius.php
|
||||
data_dir = /data/iris
|
||||
|
||||
#[listenbrainz]
|
||||
#enabled = false ; Extension disabled by user config.
|
||||
|
||||
[local]
|
||||
enabled = true
|
||||
max_search_results = 500
|
||||
media_dir = /mnt/local/music
|
||||
scan_timeout = 1000
|
||||
scan_flush_threshold = 0
|
||||
scan_follow_symlinks = false
|
||||
included_file_extensions =
|
||||
excluded_file_extensions =
|
||||
.cue
|
||||
.directory
|
||||
.html
|
||||
.log
|
||||
.nfo
|
||||
.pdf
|
||||
.txt
|
||||
.zip
|
||||
directories =
|
||||
Albums local:directory?type=album
|
||||
Artists local:directory?type=artist
|
||||
Composers local:directory?type=artist&role=composer
|
||||
Genres local:directory?type=genre
|
||||
Performers local:directory?type=artist&role=performer
|
||||
Release Years local:directory?type=date&format=%25Y
|
||||
Tracks local:directory?type=track
|
||||
Last Week's Updates local:directory?max-age=604800
|
||||
Last Month's Updates local:directory?max-age=2592000
|
||||
timeout = 10
|
||||
use_artist_sortname = true
|
||||
album_art_files =
|
||||
folder.jpg
|
||||
cover.jpg
|
||||
*.jpg
|
||||
*.png
|
||||
|
||||
[file]
|
||||
enabled = true
|
||||
media_dirs =
|
||||
/mnt/server/music
|
||||
/mnt/local/music
|
||||
excluded_file_extensions =
|
||||
.directory
|
||||
.html
|
||||
.log
|
||||
.nfo
|
||||
.pdf
|
||||
.txt
|
||||
.zip
|
||||
show_dotfiles = false
|
||||
follow_symlinks = false
|
||||
metadata_timeout = 1000
|
||||
|
||||
[http]
|
||||
enabled = true
|
||||
hostname = ::
|
||||
port = 6680
|
||||
zeroconf = Mopidy HTTP server on $hostname
|
||||
allowed_origins =
|
||||
192.168.178.100
|
||||
172.21.0.3
|
||||
localhost
|
||||
csrf_protection = false
|
||||
default_app = mopidy
|
||||
|
||||
[m3u]
|
||||
enabled = true
|
||||
base_dir = /music
|
||||
default_encoding = latin-1
|
||||
default_extension = .m3u8
|
||||
playlists_dir =
|
||||
|
||||
[softwaremixer]
|
||||
enabled = true
|
||||
|
||||
[stream]
|
||||
enabled = true
|
||||
protocols =
|
||||
http
|
||||
https
|
||||
mms
|
||||
rtmp
|
||||
rtmps
|
||||
rtsp
|
||||
metadata_blacklist =
|
||||
timeout = 5000
|
||||
|
||||
[mpd]
|
||||
enabled = true
|
||||
hostname = ::
|
||||
connection_timeout = 120
|
||||
|
||||
[spotify]
|
||||
client_id = 64452e16-a0f3-4e2f-b92a-7bfe34d01f3b
|
||||
client_secret = Y975azhoicJ6i99gJ1EgmOWCqeCjmJT7zid8ICjdU2o=
|
||||
|
||||
[muse]
|
||||
enabled = true
|
||||
|
||||
[youtube]
|
||||
enabled = true
|
||||
|
||||
[beets]
|
||||
hostname = 192.168.178.100
|
||||
port = 8337
|
||||
Reference in New Issue
Block a user