Docker setup for whole house and remote streaming for personal use
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Steven Saus 4ee1381d0a Fix image links 1 year ago
1_reference/usr/share/snapserver more cleaning 2 years ago
build Updated docs 1 year ago
config Updated docs 1 year ago
.gitignore committing working services 1 year ago
Dockerfile adding pre-compiled snapweb, since it's not coming down with apt package. 1 year ago
LICENSE Initial commit 3 years ago
README.md Fix image links 1 year ago
docker-compose.yaml Moving mpdq to the side for now. 1 year ago
nginx_proxy_reference Ready to add in pulling down rompr and installing it 2 years ago
setup_1.png Updated docs 1 year ago
setup_2.png Updated docs 1 year ago

README.md

docker-music-streaming

I've written a couple of guides on how to get whole-house audio and streaming by using mpd, snapcast, and other FOSS projects. I've previously described it as a weekend project, but by using Docker, it's a trivial setup.

Included are:

  • mpd for music playing and remote streaming
  • snapcast (and snapweb) for whole-house streaming
  • mpdscribble for scrobbling to last.fm / libre.fm
  • minidlna for upnp serving
  • RompR web interface (for controlling the whole thing)
  • Nginx proxy fragment
  • music directory and configurations accessible from host (at least at spinup)

Contents

  1. About
  2. License
  3. Prerequisites
  4. Installation
  5. Notes

1. About

This is intended to be dropped behind a reverse proxy. Setting up docker, docker-compose, and the reverse proxy is beyond the scope of this document. Likewise, handling SSL certificates should be done at the level of the host.

Many, many thanks to Toward Data Science whose post pointed me to how to get several things running together.

2. License

This project is licensed under the Apache License. For the full license, see LICENSE.

3. Prerequisites

Docker and docker-compose

If you have minidlna running on the host, you cannot also have it running in the container due to port conflicts.

4. Installation

  1. Clone or download this repository.

  2. Change into the directory you put these files into. Create a symbolic link to your already existing music directory (no need to move it!) by typing ln -s /path/to/mymusic ./music (substituting /path/to/mymusic with the path to your music collection.)

  3. Optional Add your last.fm / libre.fm login for mpdscribble in config/mpdscribble.conf.

  4. Optional If you wish to change the password for MPD, it's in config/mpd.conf. By default, it is set to mycomplicatedpassword. If you change the password, you will also have to change it for mpdscribble and each of the run-* scripts in ./build.

  5. Bring up the container with docker-compose up -d --build. Get a drink or stretch or something, it'll take a while.

  6. Point your browser at http://localhost:8880 Note that it is http, not httpS. You should see RompR's main interface. Click the gear icon, then click Edit Players.

Edit Players

Then add the password - by default, mycomplicatedpassword - to the password field.

Add Password

Then click the blinking "Update Music Collection Now" button. Stretch again. Avoid repetitive stress injuries. Also, if you have a large collection, this may take a while.

  1. At this point you should have a fully-functional installation. You get to RompR by pointing your browser at http://localhost:8880. You can access the stream at http://localhost:8881 with pretty much anything that can handle MP3s. Snapcast should auto-discover using avahi, and you can access the Snapweb interface at http://localhost:1780.

  2. Optional-ish Change the relevant proxy port for the reverse proxy to 8880, and for the stream to 8881. The specifics will vary depending on what your reverse proxy is. For example, if you're using nginx, the relevant portion of the config should look something like this:

server {
    server_name example.com;
    location /mpd.mp3 {
        proxy_pass http://localhost:8881;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;     
    }
    location / {
        proxy_pass http://192.168.1.101:8880;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
    }
}

5. Notes

  • There are several d-bus mounts that are required for avahi to talk to the rest of the network outside the Docker container. This is pretty much the only way (without installing additional software outside the container) to get avahi to work.

  • This repository contains a prebuilt version of snapweb, because the Debian package apparently does not contain it by default, and making it from source requires TypeScript, which requires NPM, and man, these images are already too big... but if you don't trust my build, or want to substitute one of your own, literally just replace build/snapweb with what you build yourself.

  • You may need to bring the container down and then back up to get it to recognize changes to the music directory on the host.

  • This Docker image is UNOPTIMIZED. I'm sure it pulls in way more than is actually needed, but my focus here was getting a MVP that worked essentially out of the box.