Make example docker-compose.yml work

This commit is contained in:
Luca 2020-09-20 23:22:29 +02:00
parent bd3ffed862
commit 41841c4873
5 changed files with 72 additions and 3 deletions

View File

@ -5,18 +5,44 @@ services:
endpoint: endpoint:
image: nginx-rtmp:alpine3.12 image: nginx-rtmp:alpine3.12
restart: always restart: always
networks:
static:
ipv4_address: 172.23.42.2
ports:
- 127.0.0.1:1935:1935
volumes: volumes:
- /srv/streaming/streams:/etc/nginx/streams.d:ro - /srv/streaming/core/streams:/etc/nginx/streams.d:ro
# stream relay, edge # stream relay, edge
relay: relay:
image: nginx-rtmp:alpine3.12 image: nginx-rtmp:alpine3.12
restart: always restart: always
networks:
static:
ipv4_address: 172.23.42.3
default:
volumes: volumes:
- /srv/streaming/streams:/etc/nginx/streams.d:ro - /srv/streaming/edge/streams:/etc/nginx/streams.d:ro
- /srv/streaming/conf:/etc/nginx/conf.d:ro - /srv/streaming/edge/conf:/etc/nginx/conf.d:ro
# Playout website # Playout website
playout: playout:
image: stream-playout:stable-alpine image: stream-playout:stable-alpine
restart: always restart: always
# NGINX proxy
proxy:
image: nginx:stable-alpine
restart: always
ports:
- 127.0.0.1:8042:80
volumes:
- /srv/streaming/proxy.conf:/etc/nginx/conf.d/default.conf:ro
networks:
static:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.23.42.0/24

View File

@ -0,0 +1,9 @@
application example {
live on;
push relay;
allow publish 172.23.42.0/24;
deny publish all;
deny play all;
}

View File

@ -0,0 +1,9 @@
server {
listen 80;
location /hls {
add_header Access-Control-Allow-Origin *;
root /var/www/live;
}
}

View File

@ -0,0 +1,10 @@
application example {
live on;
hls on;
hls_path /var/www/live/hls;
allow publish 172.23.42.0/24;
deny publish all;
deny play all;
}

15
srv/streaming/proxy.conf Normal file
View File

@ -0,0 +1,15 @@
server {
listen 80;
location / {
proxy_pass http://playout:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /hls {
proxy_pass http://relay:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}