Use tomcat as servlet engine

This commit is contained in:
Cyrille Nofficial 2015-10-28 23:30:26 +01:00
parent d8ef67a251
commit 429ff0cc41
2 changed files with 9 additions and 27 deletions

View file

@ -1,39 +1,27 @@
FROM java:8 FROM tomcat:8-jre8
MAINTAINER Cyrille Nofficial<cynoffic@cyrilix.fr> MAINTAINER Cyrille Nofficial<cynoffic@cyrilix.fr>
ENV SUBSONIC_VERSION 5.3 ENV SUBSONIC_VERSION 5.3
ENV PORT 8080
ENV CONTEXT_PATH /
LABEL version="$SUBSONIC_VERSION" LABEL version="$SUBSONIC_VERSION"
LABEL description="Subsonic media streamer" LABEL description="Subsonic media streamer"
RUN apt-get update &&\ RUN apt-get update &&\
apt-get -y install libav-tools lame &&\ apt-get -y install libav-tools lame &&\
adduser --system --home /opt/subsonic subsonic &&\
mkdir -p /opt/data/transcode /opt/music/ /opt/playlist/ /opt/podcast/ &&\ mkdir -p /opt/data/transcode /opt/music/ /opt/playlist/ /opt/podcast/ &&\
chown -R subsonic /opt/data /opt/playlist/ /opt/podcast/ &&\
ln -s /usr/bin/lame /opt/data/transcode/lame &&\ ln -s /usr/bin/lame /opt/data/transcode/lame &&\
ln -s /usr/bin/avconv /opt/data/transcode/ffmpeg &&\ ln -s /usr/bin/avconv /opt/data/transcode/ffmpeg &&\
wget "http://downloads.sourceforge.net/project/subsonic/subsonic/$SUBSONIC_VERSION/subsonic-$SUBSONIC_VERSION-standalone.tar.gz?r=http%3A%2F%2Fwww.subsonic.org%2Fpages%2Fdownload2.jsp%3Ftarget%3Dsubsonic-$SUBSONIC_VERSION-standalone.tar.gz&ts=1431096340&use_mirror=garr" \ cd ${CATALINA_HOME}/webapps/ &&\
-O- --quiet | tar zxv -C /opt/subsonic wget "http://downloads.sourceforge.net/project/subsonic/subsonic/$SUBSONIC_VERSION/subsonic-$SUBSONIC_VERSION-war.zip?r=http%3A%2F%2Fwww.subsonic.org%2Fpages%2Fdownload2.jsp%3Ftarget%3Dsubsonic-$SUBSONIC_VERSION-standalone.tar.gz&ts=1431096340&use_mirror=garr" \
-O subsonic.war.zip --quiet &&\
unzip subsonic.war.zip && rm subsonic.war.zip
ENV JAVA_OPTS="-Dsubsonic.home=/opt/data -Dsubsonic.defaultMusicFolder=/opt/music/ -Dsubsonic.defaultPodcastFolder=/opt/podcast/ -Dsubsonic.defaultPlaylistFolder=/opt/playlist/"
VOLUME /opt/data VOLUME /opt/data
VOLUME /opt/music/ VOLUME /opt/music/
VOLUME /opt/playlist/ VOLUME /opt/playlist/
VOLUME /opt/podcast/ VOLUME /opt/podcast/
EXPOSE $PORT EXPOSE 8080
WORKDIR /opt/subsonic WORKDIR /opt/subsonic
USER subsonic
CMD java -Xmx100m \
-Dsubsonic.home=/opt/data \
-Dsubsonic.port=$PORT \
-Dsubsonic.contextPath=$CONTEXT_PATH \
-Dsubsonic.defaultMusicFolder=/opt/music/ \
-Dsubsonic.defaultPodcastFolder=/opt/podcast/ \
-Dsubsonic.defaultPlaylistFolder=/opt/playlist/ \
-Djava.awt.headless=true \
-verbose:gc \
-jar /opt/subsonic/subsonic-booter-jar-with-dependencies.jar

View file

@ -4,7 +4,7 @@ Docker (http://docker.io) image for the Subsonic media streamer.
## Noteworthy ## Noteworthy
* Subsonic 5.3.beta2 (http://www.subsonic.org) * Subsonic 5.3 (http://www.subsonic.org)
## Build your own image ## Build your own image
@ -35,10 +35,4 @@ $ docker run \
``` ```
## Configuration
Specify env variables:
* CONTEXT_PATH = The context path, i.e., the last part of the Subsonic URL. Typically '/' or '/subsonic'. Default '/'
* PORT = The port on which Subsonic will listen for incoming HTTP traffic. Default: 8080