/ docker / docker-streaming.org
docker-streaming.org
  1  #+TITLE: Asteroid Radio - Docker Streaming Setup
  2  #+AUTHOR: Asteroid Radio Team
  3  #+DATE: 2025-09-30
  4  
  5  This setup provides a complete streaming solution using Docker with Liquidsoap and Icecast2.
  6  
  7  * Quick Start
  8  
  9  1. *Ensure you have music files in the =./music/= directory*
 10  2. *Start the streaming services:*
 11     #+BEGIN_SRC bash
 12     ./start-streaming.sh
 13     #+END_SRC
 14  
 15  * What's Included
 16  
 17  - *Icecast2*: Streaming server (port 8000)
 18  - *Liquidsoap*: Audio processing and streaming client
 19  - *Automatic playlist*: Randomized playback from =./music/= directory
 20  - *Multiple stream qualities*: 128kbps and 64kbps MP3 streams
 21  - *Audio processing*: Normalization, crossfading, metadata handling
 22  
 23  * Stream URLs
 24  
 25  - *High Quality (128kbps)*: http://localhost:8000/asteroid.mp3
 26  - *Low Quality (64kbps)*: http://localhost:8000/asteroid-low.mp3
 27  
 28  * Admin Interfaces
 29  
 30  - *Icecast Admin*: http://localhost:8000/admin/
 31    - Username: =admin=
 32    - Password: =asteroid_admin_2024=
 33  
 34  - *Asteroid Web Interface*: http://localhost:8080/asteroid/
 35    - Username: =admin=
 36    - Password: =asteroid123=
 37  
 38  * Manual Commands
 39  
 40  ** Start Services
 41  #+BEGIN_SRC bash
 42  docker compose up -d
 43  #+END_SRC
 44  
 45  ** Stop Services
 46  #+BEGIN_SRC bash
 47  docker compose down
 48  #+END_SRC
 49  
 50  ** View Logs
 51  #+BEGIN_SRC bash
 52  # All services
 53  docker compose logs -f
 54  
 55  # Specific service
 56  docker compose logs -f liquidsoap
 57  docker compose logs -f icecast
 58  #+END_SRC
 59  
 60  ** Restart Services
 61  #+BEGIN_SRC bash
 62  docker compose restart
 63  #+END_SRC
 64  
 65  ** Control Liquidsoap via Telnet
 66  #+BEGIN_SRC bash
 67  telnet localhost 1234
 68  #+END_SRC
 69  
 70  Common telnet commands:
 71  - =help= - Show available commands
 72  - =request.queue= - Show current queue
 73  - =request.push /path/to/file.mp3= - Add specific file to queue
 74  - =var.get volume= - Get current volume
 75  - =var.set volume 0.8= - Set volume (0.0 to 1.0)
 76  
 77  * File Structure
 78  
 79  #+BEGIN_EXAMPLE
 80  asteroid/docker/
 81  ├── docker-compose.yml          # Docker orchestration
 82  ├── Dockerfile.liquidsoap       # Simple Dockerfile using official image
 83  ├── icecast.xml                # Icecast2 configuration
 84  ├── asteroid-radio-docker.liq   # Liquidsoap script for Docker
 85  ├── start.sh                   # Simple start script
 86  ├── stop.sh                    # Simple stop script
 87  ├── docker-streaming.org        # This documentation
 88  └── setup-complete.org         # Setup summary
 89  #+END_EXAMPLE
 90  
 91  * Configuration
 92  
 93  ** Adding Music
 94  1. Place music files (MP3, FLAC, OGG, WAV) in your music directory
 95  2. Update =docker-compose.yml= to mount your music directory
 96  3. Liquidsoap will automatically detect and play them
 97  4. Playlist reloads every hour or when files change
 98  
 99  ** Customizing Streams
100  Edit =asteroid-radio-docker.liq= to:
101  - Change bitrates
102  - Add more stream outputs
103  - Modify audio processing
104  - Adjust crossfade settings
105  
106  ** Icecast Configuration
107  Edit =icecast.xml= to:
108  - Change passwords
109  - Modify listener limits
110  - Add more mount points
111  - Configure logging
112  
113  ** Docker Image
114  Uses official =savonet/liquidsoap:latest= image:
115  - Pre-built with all audio codecs (MP3, FLAC, OGG, WAV, etc.)
116  - System agnostic - works on any Docker-capable system
117  - Maintained by the Liquidsoap team
118  - Fast builds - no compilation required
119  
120  * Troubleshooting
121  
122  ** Services won't start
123  #+BEGIN_SRC bash
124  # Check Docker status
125  docker info
126  
127  # Check service logs
128  docker compose logs
129  #+END_SRC
130  
131  ** No audio in stream
132  1. Verify music files exist in =./music/=
133  2. Check Liquidsoap logs: =docker compose logs liquidsoap=
134  3. Ensure file formats are supported (MP3, FLAC, OGG, WAV)
135  
136  ** Can't connect to stream
137  1. Check if Icecast is running: =docker compose ps=
138  2. Verify port 8000 is not blocked by firewall
139  3. Check Icecast logs: =docker compose logs icecast=
140  
141  ** Permission issues
142  #+BEGIN_SRC bash
143  # Fix file permissions
144  chmod +x start-streaming.sh
145  chmod 644 icecast.xml asteroid-radio-docker.liq
146  #+END_SRC
147  
148  * Integration with Asteroid Web Interface
149  
150  The Asteroid web application can be updated to show the correct streaming status by checking if the Docker services are running. The admin dashboard will show:
151  
152  - *Liquidsoap Status*: 🟢 Running (when Docker container is up)
153  - *Icecast Status*: 🟢 Running (when Docker container is up)
154  
155  * Windows/WSL Notes
156  
157  This setup works in WSL (Windows Subsystem for Linux) with Docker Desktop:
158  
159  1. Ensure Docker Desktop is running
160  2. Use WSL2 backend for better performance
161  3. Access streams via =localhost= from Windows browsers
162  4. File paths should use Linux format in WSL
163  
164  * Production Deployment
165  
166  For production use:
167  1. Change all default passwords in =icecast.xml=
168  2. Use environment variables for sensitive configuration
169  3. Set up proper SSL/TLS certificates
170  4. Configure firewall rules appropriately
171  5. Consider using Docker secrets for password management