Skip to content

Commit

Permalink
fix(docker-compose): fix ports and descriptions for example containers
Browse files Browse the repository at this point in the history
  • Loading branch information
uZer committed Nov 5, 2023
1 parent 2e5290e commit 77211f6
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 53 deletions.
10 changes: 6 additions & 4 deletions .res/info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ srt://127.0.0.1:10014 # Liquidsoap (myradiosurround) SRT input port
srt://127.0.0.1:10015 # Liquidsoap (myradiosurround) SRT input port override_caller2
srt://127.0.0.1:10016 # Liquidsoap (myradiosurround) SRT input port sat_sat1

# Liquidsoap streamer (source-mystreamer)
# Liquidsoap surround SRT streamer (source-mystreamersurround)
http://127.0.0.1:9021/metrics # Liquidsoap (myradiosurround) Prometheus Metrics
http://127.0.0.1:7020/livesource # Liquidsoap (myradiosurround) HTTP API

Expand All @@ -33,15 +33,17 @@ http://127.0.0.1:8000/myradio-midfi.aac # Icecast mountpoint (AAC midfi
http://127.0.0.1:8000/myradio-lofi.aac # Icecast mountpoint (AAC lofi)
http://127.0.0.1:8000/myradio-midfi.mp3 # Icecast mountpoint (MP3 midfi)
http://127.0.0.1:8000/myradio-lofi.mp3 # Icecast mountpoint (MP3 lofi)
http://127.0.0.1:8000/myradiosurround-hifi.aac # Icecast mountpoint (AAC hifi surround)
http://127.0.0.1:8000/myradiosurround-insane.aac # Icecast mountpoint (AAC insane 320kbps 5.1)

# NGINX (HLS, only AAC audio)
http://127.0.0.1:8080 # Browse HLS files
http://127.0.0.1:8080/myradio/myradio.m3u8 # HLS playlist
http://127.0.0.1:8080/myradio/myradio_hifi.m3u8 # HLS playlist (enforce hifi)
http://127.0.0.1:8080/myradio/myradio_midfi.m3u8 # HLS playlist (enforce midfi)
http://127.0.0.1:8080/myradio/myradio_lofi.m3u8 # HLS playlist (enforce lofi)
http://127.0.0.1:8080/myradiosurround/myradiosurround_hifi.m3u8 # HLS playlist (enforce lofi)

http://127.0.0.1:8080/myradiosurround/myradiosurround.m3u8 # HLS playlist
http://127.0.0.1:8080/myradiosurround/myradiosurround_insane.m3u8 # HLS playlist (enforce insane profile)

# Prometheus
http://127.0.0.1:9090 # Prometheus web interface
Expand All @@ -53,4 +55,4 @@ http://127.0.0.1:3000 # Grafana web interface
curl -s -d override_caller1 http://127.0.0.1:7000/livesource

# Switch livesource for myradiosurround (please replace override_caller1 with anything you need)
curl -s -d override_caller1 http://127.0.0.1:7010/livesource
curl -s -d voieB_caller1 http://127.0.0.1:7010/livesource
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,32 @@ artifact: ## Build binary artifact
@md5sum rf-liquidsoap-$(version).tar.gz

test: ## Run test on the liquidsoap configuration
@docker compose up liquidsoap-test-transcoder liquidsoap-test-streamer
@docker compose up \
liquidsoap-test-transcoder-stereo \
liquidsoap-test-streamer-stereo \
liquidsoap-test-transcoder-surround \
liquidsoap-test-streamer-surround

reload: ## Update containers if needed and restart all liquidsoaps
@docker compose up -d
@docker compose restart liquidsoap-test-transcoder liquidsoap-test-streamer
@docker compose restart liquidsoap-myradio liquidsoap-myradiosurround source-mystreamer
@docker compose restart \
liquidsoap-test-transcoder-stereo \
liquidsoap-test-streamer-stereo \
liquidsoap-test-transcoder-surround \
liquidsoap-test-streamer-surround
@docker compose restart \
liquidsoap-myradio \
liquidsoap-myradiosurround \
# source-mystreamer \
source-mystreamersurround \
@docker compose ps
@docker compose logs -f

reload-streamer: ## Update containers if needed and restart source-mystreamer
reload-streamers: ## Update containers if needed and restart source-mystreamersurround
@docker compose up -d
@docker compose restart source-mystreamer
@docker compose restart \
# source-mystreamer \
source-mystreamersurround
@docker compose ps
@docker compose logs -f

Expand Down
130 changes: 90 additions & 40 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
version: "3.3"
services:
# Test validity of liquidsoap configurations
liquidsoap-test-transcoder:
command:
- -c
- /conf/myradio.liq
- /scripts/transcoder/00-live.liq
container_name: liquidsoap-test-transcoder
image: savonet/liquidsoap:rolling-release-v2.2.x
networks:
- default
volumes:
- ./example/liquidsoap/:/conf/:ro
- ./scripts/transcoder/:/scripts/transcoder/:ro

liquidsoap-test-streamer:
command:
- -c
- /conf/mystreamer.liq
- /scripts/streamer/00-live.liq
container_name: liquidsoap-test-streamer
image: savonet/liquidsoap:rolling-release-v2.2.x
networks:
- default
volumes:
- ./example/liquidsoap/:/conf/:ro
- ./scripts/streamer/:/scripts/streamer/:ro
###############
# TRANSCODERS #
###############

# Run liquidsoap and create "myradio" stream
liquidsoap-myradio:
Expand Down Expand Up @@ -78,7 +56,11 @@ services:
- data_hls:/tmp/
- data_liquidsoap:/state/

# Feed liquidsoap with an example SRT source (https://modular-station.com/)
###############
# SRT SOURCES #
###############

# Feed myradio with an example SRT source (https://modular-station.com/)
source-voieA-caller1:
command:
- /usr/bin/ffmpeg
Expand All @@ -99,7 +81,7 @@ services:
- default
restart: unless-stopped

# Feed liquidsoap with an example SRT source (https://p-node.org/)
# Feed myradio with an example SRT source (https://p-node.org/)
source-voieB-caller1:
command:
- /usr/bin/ffmpeg
Expand All @@ -120,7 +102,7 @@ services:
- default
restart: unless-stopped

# Feed liquidsoap with an example SRT source (https://datafruits.fm)
# Feed myradio with an example override SRT source (https://datafruits.fm)
source-override-caller1:
command:
- /usr/bin/ffmpeg
Expand All @@ -141,26 +123,27 @@ services:
- default
restart: unless-stopped

# Feed liquidsoap with an example SRT source with liquidsoap (local playlist)
source-mystreamer:
# Feed myradiosurround with an example 5.1 SRT source with liquidsoap
# (local playlist)
source-mystreamersurround:
command:
- /conf/mystreamer.liq
- /conf/mystreamersurround.liq
- /scripts/streamer/00-live.liq
container_name: source-mystreamer
container_name: source-mystreamersurround
image: savonet/liquidsoap:rolling-release-v2.2.x
networks:
- default
restart: unless-stopped
ports:
- 9021:9021/tcp
- 7020:7020/tcp
- 9031:9031/tcp
- 7030:7030/tcp
volumes:
- ./example/audio/:/audio/:ro
- ./example/liquidsoap/:/conf/:ro
- ./scripts/streamer/:/scripts/streamer/:ro

# Feed liquidsoap with an example SRT source (local file)
source-surround:
source-ffmpegsurround:
command:
- /usr/bin/ffmpeg
- -hide_banner
Expand All @@ -173,7 +156,7 @@ services:
- -codec:a
- pcm_s24le
- "srt://liquidsoap-myradiosurround:10012" # voieB_caller1
container_name: source-surround
container_name: source-ffmpegsurround
entrypoint: []
image: savonet/liquidsoap:rolling-release-v2.2.x
networks:
Expand All @@ -182,7 +165,11 @@ services:
volumes:
- ./example/audio/:/audio/:ro

# Streaming services: icecast
#####################
# STREAMING SERVERS #
#####################

# Icecast
icecast:
container_name: icecast
environment:
Expand All @@ -198,7 +185,7 @@ services:
ports:
- 8000:8000

# Streaming services: hls (nginx)
# HLS (nginx)
hls:
container_name: hls
expose:
Expand All @@ -213,7 +200,11 @@ services:
- ./example/nginx/:/etc/nginx/conf.d/:ro
- data_hls:/hls:ro

# Monitoring
##############
# MONITORING #
##############

# Dashboards
grafana:
container_name: grafana
depends_on:
Expand All @@ -234,6 +225,8 @@ services:
volumes:
- ./example/grafana/provisioning:/etc/grafana/provisioning:ro
- data_grafana:/var/lib/grafana

# Collector
prometheus:
command:
- '--config.file=/etc/prometheus/prometheus.yml'
Expand Down Expand Up @@ -276,7 +269,7 @@ services:
# volumes:
# - ./example/alertmanager:/etc/alertmanager

# Container metrics
# Container / system metrics
# cadvisor:
# container_name: cadvisor
# depends_on:
Expand All @@ -295,6 +288,63 @@ services:
# ports:
# - 6379:6379

#########
# TESTS #
#########

# Test validity of liquidsoap configurations
liquidsoap-test-transcoder-stereo:
command:
- -c
- /conf/myradio.liq
- /scripts/transcoder/00-live.liq
container_name: liquidsoap-test-transcoder-stereo
image: savonet/liquidsoap:rolling-release-v2.2.x
networks:
- default
volumes:
- ./example/liquidsoap/:/conf/:ro
- ./scripts/transcoder/:/scripts/transcoder/:ro

liquidsoap-test-transcoder-surround:
command:
- -c
- /conf/myradiosurround.liq
- /scripts/transcoder/00-live.liq
container_name: liquidsoap-test-transcoder-surround
image: savonet/liquidsoap:rolling-release-v2.2.x
networks:
- default
volumes:
- ./example/liquidsoap/:/conf/:ro
- ./scripts/transcoder/:/scripts/transcoder/:ro

liquidsoap-test-streamer-stereo:
command:
- -c
- /conf/mystreamer.liq
- /scripts/streamer/00-live.liq
container_name: liquidsoap-test-streamer-stereo
image: savonet/liquidsoap:rolling-release-v2.2.x
networks:
- default
volumes:
- ./example/liquidsoap/:/conf/:ro
- ./scripts/streamer/:/scripts/streamer/:ro

liquidsoap-test-streamer-surround:
command:
- -c
- /conf/mystreamersurround.liq
- /scripts/streamer/00-live.liq
container_name: liquidsoap-test-streamer-surround
image: savonet/liquidsoap:rolling-release-v2.2.x
networks:
- default
volumes:
- ./example/liquidsoap/:/conf/:ro
- ./scripts/streamer/:/scripts/streamer/:ro

volumes:
data_grafana: {}
data_hls: {}
Expand Down
6 changes: 3 additions & 3 deletions example/liquidsoap/mystreamer.liq
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
streamer_name = "mystreamer"

# Radio settings
formats_picker = fun (formats) -> formats.stereo
formats_picker = fun (formats) -> formats.flac.stereo
harbor_http_port = 7020
prometheus_server_port = 9021
liquidsoap_log_level = 3
Expand All @@ -10,5 +10,5 @@ liquidsoap_log_level = 3
input_playlist_file = "/audio/lib/#{streamer_name}.m3u"

# SRT output configuration
srt_host = "liquidsoap-myradiosurround"
srt_port = 10010
srt_host = "liquidsoap-myradio"
srt_port = 10005 # override_caller2
2 changes: 1 addition & 1 deletion example/liquidsoap/mystreamersurround.liq
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ input_playlist_file = "/audio/lib/#{streamer_name}.m3u"

# SRT output configuration
srt_host = "liquidsoap-myradiosurround"
srt_port = 10010
srt_port = 10010 # voieA_caller1

0 comments on commit 77211f6

Please sign in to comment.