diff --git a/Dockerfile b/Dockerfile index 383e5ac..362e8e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,42 +1,28 @@ -FROM r.batts.cloud/debian:bookworm as extract -COPY jre-8u411-linux-x64.tar.gz / -RUN mkdir -p /usr/java &&\ - tar -C /usr/java -xvf jre-8u411-linux-x64.tar.gz +FROM tomcat:8-jre8 +LABEL MAINTAINER Cyrille Nofficial + +ENV SUBSONIC_VERSION 6.1.1 -FROM r.batts.cloud/debian:bookworm -ENV SUBSONIC_VERSION 6.1.6 -ENV JAVA_HOME /usr/java/jre1.8.0_411 -ENV PATH $JAVA_HOME/bin:$PATH -LABEL description="Subsonic media streamer" LABEL version="$SUBSONIC_VERSION" +LABEL description="Subsonic media streamer" -## TODO redo with https://github.com/airsonic-advanced/airsonic-advanced/releases/tag/v10.6.0 +RUN apt-get update &&\ + apt-get -y install libav-tools lame &&\ + mkdir -p /opt/data/transcode /opt/music/ /opt/playlist/ /opt/podcast/ &&\ + ln -s /usr/bin/lame /opt/data/transcode/lame &&\ + ln -s /usr/bin/avconv /opt/data/transcode/ffmpeg &&\ + cd ${CATALINA_HOME}/webapps/ &&\ + rm -rf ROOT &&\ + 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 && mv subsonic.war ROOT.war + +ADD server.xml /usr/local/tomcat/conf/ +ENV JAVA_OPTS="-Dsubsonic.contextPath=/ -Dsubsonic.home=/opt/data -Dsubsonic.defaultMusicFolder=/opt/music/ -Dsubsonic.defaultPodcastFolder=/opt/podcast/ -Dsubsonic.defaultPlaylistFolder=/opt/playlist/" -RUN apt update &&\ - apt -y dist-upgrade &&\ - apt -y install --no-install-recommends ffmpeg lame &&\ - apt clean -y &&\ - rm -rf /var/lib/apt/lists/* &&\ - mkdir -p /opt/data/transcode /opt/music/ /opt/playlist/ /opt/podcast/ &&\ - ln -s /usr/bin/lame /opt/data/transcode/lame &&\ - ln -s /usr/bin/avconv /opt/data/transcode/ffmpeg &&\ - curl -o subsonic.tar.gz -SL "https://sourceforge.net/projects/subsonic/files/subsonic/$SUBSONIC_VERSION/subsonic-$SUBSONIC_VERSION-standalone.tar.gz/download" &&\ - mkdir -p /opt/subsonic &&\ - tar -C /opt/subsonic -xf subsonic.tar.gz &&\ - rm /subsonic.tar.gz -COPY --from=extract /usr/java/jre1.8.0_411 /usr/java/jre1.8.0_411 -EXPOSE 4040 -EXPOSE 4043 VOLUME /opt/data VOLUME /opt/music/ VOLUME /opt/playlist/ VOLUME /opt/podcast/ -ENV SUBSONIC_HOME /opt/data -ENV SUBSONIC_PORT 4040 -ENV SUBSONIC_HTTPS_PORT 0 -ENV SUBSONIC_MAX_MEMORY 250 -ENV SUBSONIC_DEFAULT_MUSIC_FOLDER /opt/music -ENV SUBSONIC_DEFAULT_PODCAST_FOLDER /opt/podcast -ENV SUBSONIC_DEFAULT_PLAYLIST_FOLDER /opt/playlist -ENV HOME /opt/data -CMD /opt/subsonic/subsonic.sh && tail -f /opt/data/subsonic_sh.log + + diff --git a/README.md b/README.md index 232fba7..c5ba1de 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,37 @@ -This repository contains configuration files for building a [Docker](https://github.com/docker/docker) image for the Subsonic media streamer. +This repository contains configuration files for building a +Docker (http://docker.io) image for the Subsonic media streamer. ## Noteworthy -* Subsonic (http://www.subsonic.org) -* Still is Java 8 ... (https://www.java.com/download/manual.jsp) +* Subsonic 6.0 (http://www.subsonic.org) ## Build your own image ```shell -docker build -t $USER/subsonic . +$ docker build -t /docker-subsonic . ``` +## Get a pre-built image + +A current image is available as a trusted build from the Docker index: + +```shell +$ docker pull cyrilix/subsonic +``` + +The repository page is at +https://index.docker.io/u/cyrilix/subsonic/ + + ## Run a container with this image ```shell -docker run \ - -it \ - --rm \ - -p 4040:4040 \ - -p 4043:4043 \ +$ docker run \ + --detach \ + --publish 8080:8080 \ --volume "/wherever/your/music/is:/opt/music/:ro" \ - $USER/subsonic + /subsonic ``` diff --git a/data/.gitkeep b/data/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index a2ef5d2..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: "3" -services: - subsonic: - #image: vbatts/subsonic - network_mode: "host" - build: - context: . - dockerfile: Dockerfile - read_only: true - tmpfs: - - /tmp - #ports: - #- 0.0.0.0:4040:4040/tcp - #- 0.0.0.0:4043:4043/tcp - restart: always - volumes: - - ./data:/opt/data/ - - /mnt/audio/Music:/opt/music diff --git a/server.xml b/server.xml new file mode 100644 index 0000000..7dce9e6 --- /dev/null +++ b/server.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +