An easy way to have a 24/7 audio stream of music.

Merge branch 'master' into rita-moe

+2 -2
README.md
···
## Install
- Copy `.env.example` to `.env` and edit it
- Put music inside `music/`
-
- Run `docker-compose up -d`
+
- Run `docker compose up -d`
- Listen to `http://localhost:8000/live`
- Change `8000` with your `ICECAST_PORT`, `live` with your `STREAM_MOUNTPOINT`
···
- `STREAM_NAME`: A title for your stream.
- `STREAM_DESC`: A description for your stream.
-
- `STREAM_URL`: A URL (like your website) to show on the stream details.
+
- `STREAM_URL`: An URL (like your website) to show on the stream details.
- `STREAM_MOUNTPOINT`: The name of the mountpoint that Liquidsoap will use.
- `ICECAST_PORT`: The port to bind Icecast in the open.
- `ICECAST_SOURCE_PASSWORD`: The password to stream audio to Icecast.
+3 -4
docker-compose.yml
···
-
version: '3'
+
version: "3.6"
services:
icecast:
-
image: "mkody/icecast"
+
image: docker.io/mkody/icecast:latest
restart: always
ports:
- "${ICECAST_PORT:-8000}:8000"
···
volumes:
- ./status.xsl:/usr/share/icecast/web/status.xsl:ro
- ./style-status.css:/usr/share/icecast/web/style-status.css:ro
-
- ./logs:/var/log/icecast
liquidsoap:
-
image: "savonet/liquidsoap:v2.1.3"
+
image: docker.io/savonet/liquidsoap:v2.2.1
restart: always
command: ["/script.liq"]
environment:
+5 -19
script.liq
···
# Allow root
settings.init.allow_root.set(true)
-
# Set environments if empty
-
if getenv("ICECAST_SOURCE_PASSWORD") == "" then
-
setenv("ICECAST_SOURCE_PASSWORD", "hackme")
-
end
-
if getenv("STREAM_NAME") == "" then
-
setenv("STREAM_NAME", "Radio")
-
end
-
if getenv("STREAM_DESC") == "" then
-
setenv("STREAM_DESC", "Our selection of music")
-
end
-
if getenv("STREAM_MOUNTPOINT") == "" then
-
setenv("STREAM_MOUNTPOINT", "live")
-
end
-
# Playlist
i_playlist = crossfade(
duration=3.0,
···
bitrate=128,
id3v2=true
),
-
name=getenv("STREAM_NAME"),
-
description=getenv("STREAM_DESC"),
-
url=getenv("STREAM_URL"),
-
mount=getenv("STREAM_MOUNTPOINT"),
-
password=getenv("ICECAST_SOURCE_PASSWORD"),
+
name=environment.get("STREAM_NAME", default="Radio"),
+
description=environment.get("STREAM_DESC", default="Our selection of music"),
+
url=environment.get("STREAM_URL"),
+
mount=environment.get("STREAM_MOUNTPOINT", default="live"),
+
password=environment.get("ICECAST_SOURCE_PASSWORD", default="hackme"),
host="icecast",
port=8000,
encoding="UTF-8",