Skip to content

Commit

Permalink
Add webdevops/liquidsoap
Browse files Browse the repository at this point in the history
  • Loading branch information
mblaschke committed Apr 6, 2017
1 parent af4330c commit 9470575
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 1 deletion.
44 changes: 44 additions & 0 deletions docker/liquidsoap/latest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#+++++++++++++++++++++++++++++++++++++++
# Dockerfile for webdevops/liquidsoap:latest
# -- automatically generated --
#+++++++++++++++++++++++++++++++++++++++

FROM webdevops/base:latest

# Install services
RUN /usr/local/bin/apt-install \
liquidsoap \
liquidsoap-plugin-all \
mplayer \
gstreamer0.10-plugins-base \
gstreamer0.10-plugins-good \
&& /usr/local/bin/docker-image-cleanup

ENV LIQUIDSOAP_USER "liquidsoap"
ENV LIQUIBASE_TELNET "1"

ENV LIQUIDSOAP_SCRIPT "/opt/docker/etc/liquidsoap/default.liq"
ENV LIQUIDSOAP_TEMPLATE "/opt/docker/etc/liquidsoap/default.liq"

ENV LIQUIBASE_STREAM_INPUT "http://icecast:8000/live"

ENV LIQUIBASE_PLAYLIST_DEFAULT "audio_to_stereo(single('/opt/docker/etc/liquidsoap/default.mp3'))"

ENV LIQUIBASE_PLAYLIST_DAY "playlist('/opt/docker/etc/liquidsoap/playlist-day.pls')"
ENV LIQUIBASE_PLAYLIST_DAY_TIMERANGE "4h-2h"

ENV LIQUIBASE_PLAYLIST_NIGHT "playlist('/opt/docker/etc/liquidsoap/playlist-night.pls')"
ENV LIQUIBASE_PLAYLIST_NIGHT_TIMERANGE "2h-14h"

ENV LIQUIBASE_OUTPUT "output.icecast(%mp3(bitrate=128),host='localhost',port=8000,password='secretpassword',mount='liquidsoap-128',name=META_name,genre=META_genre,url=META_url,description=META_desc,ALL_input)"

ENV LIQUIBASE_META_NAME "Liquidsoap Docker"
ENV LIQUIBASE_META_GENRE ""
ENV LIQUIBASE_META_URL ""
ENV LIQUIBASE_META_DESCRIPTION ""

COPY conf/ /opt/docker/

CMD ["liquidsoap"]

EXPOSE 1234
39 changes: 39 additions & 0 deletions docker/liquidsoap/latest/Dockerfile.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{ docker.from("base","latest") }}

# Install services
RUN /usr/local/bin/apt-install \
liquidsoap \
liquidsoap-plugin-all \
mplayer \
gstreamer0.10-plugins-base \
gstreamer0.10-plugins-good \
{{ docker.cleanup() }}

ENV LIQUIDSOAP_USER "liquidsoap"
ENV LIQUIBASE_TELNET "1"

ENV LIQUIDSOAP_SCRIPT "/opt/docker/etc/liquidsoap/default.liq"
ENV LIQUIDSOAP_TEMPLATE "/opt/docker/etc/liquidsoap/default.liq"

ENV LIQUIBASE_STREAM_INPUT "http://icecast:8000/live"

ENV LIQUIBASE_PLAYLIST_DEFAULT "audio_to_stereo(single('/opt/docker/etc/liquidsoap/default.mp3'))"

ENV LIQUIBASE_PLAYLIST_DAY "playlist('/opt/docker/etc/liquidsoap/playlist-day.pls')"
ENV LIQUIBASE_PLAYLIST_DAY_TIMERANGE "4h-2h"

ENV LIQUIBASE_PLAYLIST_NIGHT "playlist('/opt/docker/etc/liquidsoap/playlist-night.pls')"
ENV LIQUIBASE_PLAYLIST_NIGHT_TIMERANGE "2h-14h"

ENV LIQUIBASE_OUTPUT "output.icecast(%mp3(bitrate=128),host='localhost',port=8000,password='secretpassword',mount='liquidsoap-128',name=META_name,genre=META_genre,url=META_url,description=META_desc,ALL_input)"

ENV LIQUIBASE_META_NAME "Liquidsoap Docker"
ENV LIQUIBASE_META_GENRE ""
ENV LIQUIBASE_META_URL ""
ENV LIQUIBASE_META_DESCRIPTION ""

{{ docker.copy('conf/', '/opt/docker/') }}

{{ docker.cmd("liquidsoap") }}

{{ docker.expose('1234') }}
11 changes: 11 additions & 0 deletions docker/liquidsoap/latest/conf/bin/entrypoint.d/liquidsoap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

#############################################
## Configure and run liquibase
#############################################

if [[ -n "$LIQUIDSOAP_TEMPLATE" ]]; then
go-replace --mode=template -s Foobar -r Foobar -- "$LIQUIDSOAP_TEMPLATE"
fi

exec gosu "$LIQUIDSOAP_USER" liquidsoap "$LIQUIDSOAP_SCRIPT"
86 changes: 86 additions & 0 deletions docker/liquidsoap/latest/conf/etc/liquidsoap/default.liq
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/liquidsoap

# Lines starting with # are comments, they are ignored.

# Log path
set("log.file.path","/dev/null")

# Print log messages to the console,
# can also be done by passing the -v option to liquidsoap.
set("log.stdout", true)

# Use the telnet server for requests
{{if .Env.LIQUIBASE_TELNET}}
set("server.telnet", true)
{{end}}

##################
# Settings
##################

DJ_stream = "{{.Env.LIQUIBASE_STREAM_INPUT}}"

PLAYLIST_default = {{.Env.LIQUIBASE_PLAYLIST_DEFAULT}}
PLAYLIST_day = {{.Env.LIQUIBASE_PLAYLIST_DAY}}
PLAYLIST_night = {{.Env.LIQUIBASE_PLAYLIST_NIGHT}}

META_name = "{{.Env.LIQUIBASE_META_NAME}}"
META_genre = "{{.Env.LIQUIBASE_META_GENRE}}"
META_url = "{{.Env.LIQUIBASE_META_URL}}"
META_desc = "{{.Env.LIQUIBASE_META_DESCRIPTION}}"

## fetch dj stream
DJ_input = input.http(DJ_stream)

## fadeout dj
#DJ_input = fade.out(merge_tracks(DJ_input))

# Play user requests if there are any,
# otherwise one of our playlists,
# and the default file if anything goes wrong.
PLAYLIST_input = fallback([
switch([({ {{.Env.LIQUIBASE_PLAYLIST_DAY_TIMERANGE}} }, PLAYLIST_day),
({ {{.Env.LIQUIBASE_PLAYLIST_NIGHT_TIMERANGE}} }, PLAYLIST_night)]),
PLAYLIST_default
])

## add fade
PLAYLIST_input = smart_crossfade(fade_out=0.5, fade_in=0.5, PLAYLIST_input)

## set title
PLAYLIST_input = rewrite_metadata(
[
("title", "$(title)"),
("comment", "{{.Env.LIQUIBASE_META_URL}}")
],
PLAYLIST_input
)

# Add the ability to relay live shows
ALL_input = fallback(track_sensitive=false, [DJ_input, PLAYLIST_input])

#################
# Output
#################

{{.Env.LIQUIBASE_OUTPUT}}
{{.Env.LIQUIBASE_OUTPUT_1}}
{{.Env.LIQUIBASE_OUTPUT_2}}
{{.Env.LIQUIBASE_OUTPUT_3}}
{{.Env.LIQUIBASE_OUTPUT_4}}
{{.Env.LIQUIBASE_OUTPUT_5}}
{{.Env.LIQUIBASE_OUTPUT_6}}
{{.Env.LIQUIBASE_OUTPUT_7}}
{{.Env.LIQUIBASE_OUTPUT_8}}
{{.Env.LIQUIBASE_OUTPUT_9}}
{{.Env.LIQUIBASE_OUTPUT_10}}
{{.Env.LIQUIBASE_OUTPUT_11}}
{{.Env.LIQUIBASE_OUTPUT_12}}
{{.Env.LIQUIBASE_OUTPUT_13}}
{{.Env.LIQUIBASE_OUTPUT_14}}
{{.Env.LIQUIBASE_OUTPUT_15}}
{{.Env.LIQUIBASE_OUTPUT_16}}
{{.Env.LIQUIBASE_OUTPUT_17}}
{{.Env.LIQUIBASE_OUTPUT_18}}
{{.Env.LIQUIBASE_OUTPUT_19}}
{{.Env.LIQUIBASE_OUTPUT_20}}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#EXTM3U
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#EXTM3U
2 changes: 1 addition & 1 deletion docker/samson-deployment/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ RUN set -x \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true \
## Install go-replace
&& GOREPLACE_VERSION=0.5.0 \
&& GOREPLACE_VERSION=0.5.2 \
&& wget -O /usr/local/bin/go-replace https://github.com/webdevops/goreplace/releases/download/$GOREPLACE_VERSION/gr-64-linux \
&& chmod +x /usr/local/bin/go-replace \
&& apt-get purge -y -f --force-yes wget dirmngr \
Expand Down
18 changes: 18 additions & 0 deletions template/Dockerfile/images/liquidsoap.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% import 'Dockerfile/docker.jinja2' as docker %}
{% import 'Dockerfile/provision.jinja2' as provision %}

{% macro ubuntu(role='') -%}
# Install services
RUN /usr/local/bin/apt-install \
liquidsoap \
{{ docker.cleanup() }}
{%- endmacro %}
libasound2-plugins alsa-utils libcamomile-ocaml-dev file libsox-fmt-all
festival icecast2 liguidsoap liquidsoap-plugin-samplerate
liquidsoap-plugin-xmlplaylist mplayer perl-doc libterm-readline-gnu-perl
| libterm-readline-perl-perl make
Recommended packages:
liquidsoap-plugin-faad liquidsoap-plugin-flac liquidsoap-plugin-icecast
liquidsoap-plugin-lame liquidsoap-plugin-mad liquidsoap-plugin-pulseaudio
liquidsoap-plugin-taglib liquidsoap-plugin-voaacenc liquidsoap-plugin-vorbis
logrotate mp3gain vorbis-tools vorbisgain netbase rename
1 change: 1 addition & 0 deletions template/Dockerfile/layout.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{% import 'Dockerfile/images/nginx-dev.jinja2' as nginxdev %}
{% import 'Dockerfile/images/hhvm.jinja2' as hhvm %}
{% import 'Dockerfile/images/postfix.jinja2' as postfix %}
{% import 'Dockerfile/images/liquidsoap.jinja2' as liquidsoap %}
{% import 'Dockerfile/images/mail-sandbox.jinja2' as mailsandbox %}
{% import 'Dockerfile/images/php5.jinja2' as php5 %}
{% import 'Dockerfile/images/php7.jinja2' as php7 %}
Expand Down

0 comments on commit 9470575

Please sign in to comment.