Toastie 2 years ago
parent
commit
147129a1f0
5 changed files with 25 additions and 7 deletions
  1. 5 0
      mopidy/.gitignore
  2. 6 6
      mopidy/Dockerfile
  3. 12 0
      mopidy/README.md
  4. 0 0
      mopidy/data/etc/asound.conf
  5. 2 1
      mopidy/docker-compose.yml

+ 5 - 0
mopidy/.gitignore

@@ -0,0 +1,5 @@
+data/mopidy/music/
+data/mopidy/.cache/
+data/mopidy/.local/
+data/mopidy/.ash_history
+

+ 6 - 6
mopidy/Dockerfile

@@ -1,21 +1,21 @@
 FROM arm32v6/alpine
 
-ARG gid_input=29
+# GID of group audio on the doccker host
+ARG gid_audio=29
 
-RUN apk add --no-cache py-pip mopidy gstreamer sudo python3-dev \
+RUN apk add --no-cache py-pip mopidy gstreamer gst-plugins-bad sudo python3-dev \
  && pip3 install --upgrade pip
 
 RUN python3 -m pip install Mopidy-Iris \
  && python3 -m pip install Mopidy-MPD \
  && python3 -m pip install Mopidy-Youtube
 
-ADD mopidy.conf /var/lib/mopidy/.config/mopidy/mopidy.conf
-ADD asound.conf /etc/asound.conf
+ADD ./data/mopidy/.config/mopidy/mopidy.conf /var/lib/mopidy/.config/mopidy/mopidy.conf
+ADD ./data/etc/asound.conf /etc/asound.conf
 
 RUN chown -R mopidy /var/lib/mopidy \
  && echo "mopidy ALL=NOPASSWD: /usr/lib/python?.?/site-packages/mopidy_iris/system.sh" >> /etc/sudoers \
- && sed -i /etc/passwd -e "/^mopidy.*/s/18/$gid_input/"
-
+ && sed -i /etc/passwd -e "/^mopidy.*/s/18/$gid_audio/"
 
 USER mopidy
 

+ 12 - 0
mopidy/README.md

@@ -0,0 +1,12 @@
+# Mopidy Media Server
+
+## Mounts
+  - /dev/snd:/dev/snd  --> sound card
+  - ./data/mopidy/:/var/lib/mopidy/ --> mopidy home
+
+## Ports
+  - 6600 MPD
+  - 6680 Mopidy Web Interface, set to 80 in docker-compose.yml
+
+# Configuration
+  - Set your sound device here: `data/etc/asound.conf`

mopidy/asound.conf → mopidy/data/etc/asound.conf


+ 2 - 1
mopidy/docker-compose.yml

@@ -10,4 +10,5 @@ services:
     devices:
       - '/dev/snd:/dev/snd'
 
-#docker run -it --rm --privileged --device=/dev/snd:/dev/snd --name mpd -p 6600:6600 -p 8000:8000 -p 6680:6680 arm32v6/alpine
+    volumes:
+      - ./data/mopidy/:/var/lib/mopidy/