Sign inSign up

alex778/radio

By alex778

Updated 5 months ago

Public Radio image

Image
Web servers
0

328

alex778/radio repository overview

Radio (Icecast source) + API

This image is a small “DIY radio station” helper for Icecast.

It:

  • picks audio files from your folders and streams them into one or more Icecast mounts
  • updates Icecast metadata (track title), and can optionally inject “talk” inserts every N tracks
  • can also run a tiny Flask API (api.py) that the bundled web UI can use

Typical setup

Most people run it with the included docker-compose.yaml (Icecast + streamer + API + static web UI).

Configuration lives in:

  • .env (Icecast credentials, etc.)
  • stations.json (station name, music folder, mount, optional talk folder)

Music/talk folders are mounted as volumes.

Notes

  • Audio formats: mp3, wav, flac, ogg, m4a, aac, webm (via ffmpeg).
  • The same image is used for radio (default CMD: python radio.py) and api (override command: python api.py).

Examples

.emv
ICECAST_SOURCE_USER=source
ICECAST_SOURCE_PASSWORD=change-me
ICECAST_ADMIN_USER=admin
ICECAST_ADMIN_PASS=change-me
ICECAST_ADMIN_PASSWORD=change-me
ICECAST_PASSWORD=change-me
ICECAST_RELAY_PASSWORD=change-me
ICECAST_HOST=icecast
ICECAST_PORT=8000
stations.json
[
  {
    "name": "Demo",
    "folder": "/app/music_demo",
    "mount": "/live",
    "talk_folder": "/app/talk_rock",
    "talk_every_tracks": 3,
    "talk_history_size": 10,
    "talk_metadata_title": "Rock FM Jingle"
  }
]
docker-compose.yaml
services:
  icecast:
    image: moul/icecast
    env_file:
      - .env
    ports:
      - "9000:8000"
    environment:
      - ICECAST_SOURCE_PASSWORD=${ICECAST_SOURCE_PASSWORD}
      - ICECAST_ADMIN_PASSWORD=${ICECAST_ADMIN_PASSWORD}
      - ICECAST_PASSWORD=${ICECAST_PASSWORD}
      - ICECAST_RELAY_PASSWORD=${ICECAST_RELAY_PASSWORD}
    restart: unless-stopped

  radio:
    image: alex778/radio:v1.1
    depends_on:
      - icecast
    env_file:
      - .env
    environment:
      - CROSSFADE=false
      - STATE_DIR=/app/state
      - STATIONS_FILE=/app/config/stations.json
    volumes:
      - ./state:/app/state
      - ./stations.json:/app/config/stations.json:ro
      - ./music/demos:/app/music_demo
      # - ./talk/rock:/app/talk_rock # Talks
    restart: unless-stopped

  api:
    image: alex778/radio:v1.1
    depends_on:
      - icecast
    command: ["python", "api.py"]
    env_file:
      - .env
    environment:
      - STATIONS_FILE=/app/config/stations.json
    volumes:
      - ./stations.json:/app/config/stations.json:ro
      - ./music/demos:/app/music_demo
      # - ./talk/rock:/app/talk_rock # Talks
    restart: unless-stopped

  web:
    image: alex778/radio:v1.1-web
    ports:
      - "8083:80"
    restart: unless-stopped

Tag summary

Content type

Image

Digest

sha256:bceddc013

Size

24.8 MB

Last updated

5 months ago

docker pull alex778/radio:v1.1-web