diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..17ca05c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:trusty + +EXPOSE 4050 +EXPOSE 4051 + +RUN apt-get update && \ + apt-get install -y wget && \ + apt-get install -y openjdk-7-jre-headless wget supervisor && \ + wget -O /tmp/subsonic.deb http://subsonic.org/download/subsonic-5.3.deb && \ + dpkg -i /tmp/subsonic.deb && \ + useradd subsonic && \ + chown -R subsonic:subsonic /var/subsonic + +ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf +ADD subsonic.conf /etc/supervisor/conf.d/subsonic.conf + +ENTRYPOINT ["supervisord"] diff --git a/README.md b/README.md index 48a318b..5fcf0c0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ -#docker-subsonic +docker-subsonic +=============== [Subsonic](http://www.subsonic.org/pages/index.jsp) in a docker container. + +*Usage* + +* Build: `docker build -t subsonic .` +* Run: `docker run -d -v /hostpath/music:/var/music -p 4050:4050 -p 4051:4051 subsonic` + +*Persistence* + +To make the subsonic database persistent, a file and a dir must be mounted to the host: + +* -v /hostpath/subsonic/db:/var/subsonic/db +* -v /hostpath/subsonic/subsonic.properties:/var/subsonic/subsonic.properties + +Both locations must be read/writable by uid 1000. + +*TODO* + +* Allow specifying UID for subsonic user on the fly diff --git a/subsonic.conf b/subsonic.conf new file mode 100644 index 0000000..8f662fa --- /dev/null +++ b/subsonic.conf @@ -0,0 +1,5 @@ +[program:subsonic] +command=java -Xmx256m -Dsubsonic.home=/var/subsonic -Dsubsonic.host=0.0.0.0 -Dsubsonic.port=4051 -Dsubsonic.httpsPort=4050 -Dsubsonic.contextPath=/ -Dsubsonic.defaultMusicFolder=/var/music -Dsubsonic.defaultPodcastFolder=/var/music/Podcast -Dsubsonic.defaultPlaylistFolder=/var/playlists -Djava.awt.headless=true -verbose:gc -jar subsonic-booter-jar-with-dependencies.jar +autorestart=true +user=subsonic +directory=/usr/share/subsonic diff --git a/supervisor.conf b/supervisor.conf new file mode 100644 index 0000000..54296b8 --- /dev/null +++ b/supervisor.conf @@ -0,0 +1,2 @@ +[supervisord] +nodaemon=true