Making a Docker application
In keeping with the self-hosted/homelab theme of the last post, I decided to try my hand at creating a service to run in a Docker container, namely a local network 'radio station' organiser with a web interface. The program is written in Python (no surprises there) with the network streaming handled by VLC, the downloading of audio files (playlists) carried out by YouTube-DL, Python module Bottle fulfilling webserver duties and SQLite3 storing information about downloaded playlists and created streams. The bash commands that are used to start the VLC streams and to download a YouTube playlist are quite specific. VLC streams are launched in the background, with a never-ending, randomly selected order of file playback to be transcoded to mp3 and streamed via http. nohup cvlc -vvv ~/Music/$playlist --random --loop --sout "#gather,transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100,scodec=none}:http{mux=mp3,dst=:$port/}" --sout-keep & Down...