diff --git a/README.md b/README.md index 33fad32..4a36c5b 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,17 @@ docker run -it \ stuckj/subsonic:latest ``` +### Sonos issues +If you have problems with Subsonic's Sonos support while running in Docker, this may be due to Sonos' use of UPnP. There are a few things that can be done to fix this, but note that the following steps reduce your server's network security and carries some level of additional risk! + +[Removing network isolation](https://docs.docker.com/engine/network/) from the docker container may help. Add these parameters to the above `docker run` commands: +* `--net=host` +* `-eSUBSONIC_HOST=` + +Note that with this, the `-p` port publishing parameters are no longer necessary. + +If this still doesn't work, also try disabling the firewall on your host machine. On Ubuntu, try running `sudo ufw disable` and then restarting the container. + ## Docker compose Here is an example `docker-compose.yaml` if you choose to run with docker compose: @@ -108,6 +119,13 @@ services: - /data/subsonic-data:/var/subsonic ``` +## Running as a service +If you want to run subsonic as a service (not using Docker compose), modify [subsonic-docker.service](subsonic-docker.service) and install it: +1. Copy the file to `/etc/systemd/system/subsonic-docker.service` +2. `sudo systemctl daemon-reload` +3. `sudo systemctl enable subsonic-docker` +4. `sudo systemctl start subsonic-docker` + ## TODOs TODO: Setup auto-detection of new versions in Dockerfile (will need to scrape page). diff --git a/subsonic-docker.service b/subsonic-docker.service new file mode 100644 index 0000000..ffb2393 --- /dev/null +++ b/subsonic-docker.service @@ -0,0 +1,21 @@ +[Unit] +Description=Subsonic (Docker) Service +After=docker.service +Requires=docker.service + +[Service] +TimeoutStartSec=0 +Restart=always +ExecStartPre=-/usr/bin/docker exec %n stop +ExecStartPre=-/usr/bin/docker rm %n +ExecStartPre=/usr/bin/docker pull stuckj/subsonic:latest +ExecStart=/usr/bin/docker run --rm \ + -p "4040:4040/tcp" \ + -v /data/music:/var/music \ + -v /data/subsonic-data:/var/subsonic \ + --name="subsonic" \ + stuckj/subsonic:latest +ExecStop=/usr/bin/docker exec %n stop + +[Install] +WantedBy=default.target \ No newline at end of file