diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..216c5e0 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +kind: pipeline +name: default + +steps: +- name: build + image: busybox + commands: + - grep "ENV VERSION" Dockerfile | cut -d '=' -f2 > .tags + +- name: docker + image: plugins/docker + settings: + username: samservices + password: + from_secret: docker_password + repo: registry.samservices.de/subsonic + registry: registry.samservices.de \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c65468d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM alpine:edge +MAINTAINER Samuel Warkentin + +RUN apk --update add openjdk8-jre ffmpeg supervisor + +ENV VERSION=5.3 + +RUN adduser -D -u 1000 subsonic + +RUN wget http://s3-eu-west-1.amazonaws.com/subsonic-public/download/subsonic-$VERSION-standalone.tar.gz -O subsonic.tar.gz +RUN tar xvfz subsonic.tar.gz && rm -f subsonic.tar.gz +RUN sed -i -e 's,1 &,1,g' subsonic.sh + +VOLUME [ "/data" ] +EXPOSE 4040 + +COPY supervisord.conf /etc/supervisord.conf +COPY start-subsonic.sh / +CMD ["/usr/bin/supervisord"] \ No newline at end of file diff --git a/README.md b/README.md index e69de29..92b63f1 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,26 @@ + +This docker container publish an very nice web-based media server. + +Source : http://www.subsonic.org + + +###Getting started + +``` +docker run -it -p 4040:4040 unclesamwk/subsonic +``` +Default an volume for persist date will be created. + +###Follwing environments may be override: + +|ENV|DEFAULT|DESCRIPTION| +|---|---|---| +|HOST|0.0.0.0|The host name or IP address on which to bind Subsonic. Only relevant if you have multiple network interfaces and want to make Subsonic available on only one of them. The default value will bind Subsonic to all available network interfaces.| +|HTTP_PORT|4040|The port on which Subsonic will listen for incoming HTTP traffic.| +|HTTPS_PORT|0|The port on which Subsonic will listen for incoming HTTPS traffic.| +|CONTEXT_PATH|/|The context path, i.e., the last part of the Subsonic URL. Typically '/' or '/subsonic'.| +|MEMORY|150|The memory limit (max Java heap size) in megabytes.| + +###Comming soon + +Connect to samba active-directory \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..70d9f5e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3.7' + +services: + subsonic: + build: . + ports: + - "4040:4040" + tty: true \ No newline at end of file diff --git a/start-subsonic.sh b/start-subsonic.sh new file mode 100644 index 0000000..4664c30 --- /dev/null +++ b/start-subsonic.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# create folder on docker volume +mkdir -p /data/music +mkdir -p /data/music/podcasts +mkdir -p /data/playlists + +# run subsonic +/subsonic.sh \ +--home=/home/subsonic/subsonic-home \ +--host=${HOST:=0.0.0.0} \ +--port=${HTTP_PORT:=4040} \ +--https-port=${HTTPS_PORT:=0} \ +--context-path=${CONTEXT_PATH:="/"} \ +--max-memory=${MEMORY:=150} \ +--pidfile=/run/subsonic.pid \ +--default-music-folder=/data/music \ +--default-podcast-folder=/data/music/podcasts \ +--default-playlist-folder=/data/playlists \ No newline at end of file diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..b7dcd90 --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,19 @@ +[supervisord] +nodaemon=true +user = root + +[program:subsonic] +priority=1 +command=sh start-subsonic.sh + +[program:subsonic-log] +priority=2 +command=tail -f /home/subsonic/subsonic-home/subsonic.log +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 + +[program:subsonic-sh-log] +priority=2 +command=tail -f /home/subsonic/subsonic-home/subsonic_sh.log +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 \ No newline at end of file