This commit is contained in:
2025-11-24 16:28:52 +00:00
parent f14cc26456
commit 773cebd620
4 changed files with 80 additions and 0 deletions

19
icecast2/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM debian:latest as builder
WORKDIR /app
RUN apt-get update \
&& apt-get install --yes icecast2 gettext media-types
# RUN apt-get install --yes liquidsoap
RUN useradd radio
RUN chown -R radio:radio /etc/icecast2 /var/log/icecast2
# RUN chown -R radio:radio /etc/liquidsoap /var/log/liquidsoap
USER radio
COPY icecast.xml.template /etc/icecast2/icecast.xml.template
# COPY stream.liq.template /etc/liquidsoap/stream.liq.template
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]

11
icecast2/entrypoint.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
set -e
# Substitute environment variables into template
envsubst < /etc/icecast2/icecast.xml.template > /etc/icecast2/icecast.xml
# envsubst < /etc/liquidsoap/stream.liq.template > /etc/liquidsoap/stream.liq
# Run icecast with the generated config
exec icecast2 -c /etc/icecast2/icecast.xml
# exec liquidsoap /etc/liquidsoap/stream.liq
# wait -n

View File

@@ -0,0 +1,37 @@
<icecast>
<authentication>
<source-password>${ICECAST_SOURCE_PASSWORD}</source-password>
<relay-password>${ICECAST_RELAY_PASSWORD}</relay-password>
<admin-user>${ICECAST_ADMIN_USER}</admin-user>
<admin-password>${ICECAST_ADMIN_PASSWORD}</admin-password>
</authentication>
<hostname>${ICECAST_HOST}</hostname>
<location>London, UK</location> <!-- e.g., "London, UK" -->
<admin>adam.a.french@outlook.com</admin>
<listen-socket>
<port>${ICECAST_PORT}</port>
</listen-socket>
<mount>
<mount-name>${ICECAST_MOUNT}</mount-name>
</mount>
<limits>
<clients>100</clients>
<sources>2</sources>
</limits>
<paths>
<basedir>/usr/share/icecast2</basedir>
<logdir>/var/log/icecast2</logdir>
<webroot>/usr/share/icecast2/web</webroot>
<adminroot>/usr/share/icecast2/admin</adminroot>
<alias source="/" destination="/status.xsl"/>
</paths>
<security>
<chroot>0</chroot>
</security>
</icecast>

View File

@@ -0,0 +1,13 @@
# Microphone input
mic = input.pulseaudio()
# Icecast output
output.icecast(
%mp3,
host = "$ICECAST_HOST",
port = "$ICECAST_PORT",
password = "$ICECAST_SOURCE_PASSWORD",
mount = "$ICECAST_MOUNT",
name = "Live DJ stream",
mic
)