Add dockerfile

This commit is contained in:
dave 2016-01-02 18:33:09 -08:00
parent b3738aa7f5
commit c2816d85b3
4 changed files with 44 additions and 1 deletions

17
Dockerfile Normal file
View File

@ -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"]

View File

@ -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

5
subsonic.conf Normal file
View File

@ -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

2
supervisor.conf Normal file
View File

@ -0,0 +1,2 @@
[supervisord]
nodaemon=true