diff --git a/Dockerfile b/Dockerfile index 0709cd4..98d05f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,6 +40,9 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log && \ ln -sf /dev/stderr /var/log/nginx/error.log COPY startscript.sh /usr/sbin/startscript.sh +COPY nginx_ingest.conf /etc/nginx/nginx_ingest.conf +COPY nginx_restream.conf /etc/nginx/nginx_ingest.conf + EXPOSE 1935 CMD ["bash", "/usr/sbin/startscript.sh"] diff --git a/startscript.sh b/startscript.sh index 11e77fe..fab7088 100644 --- a/startscript.sh +++ b/startscript.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash NGINX_CONF=/etc/nginx/nginx.conf +NGINX_INGEST_CONF=/etc/nginx/nginx_ingest.conf +NGINX_RESTREAM_CONF=/etc/nginx/nginx_restream.conf if test -f "$NGINX_CONF"; then nginx -g daemon off; exit 0 @@ -29,7 +31,7 @@ if [[ $NGINX_TYPE == "ingest" ]]; then else NGINX_STREAM_KEY="${STREAM_KEY}" fi - sed -i 's@___STREAMKEY___@'"$NGINX_STREAM_KEY"'@' nginx_ingest.conf > $NGINX_CONF + sed -i 's@___STREAMKEY___@'"$NGINX_STREAM_KEY"'@' $NGINX_INGEST_CONF > $NGINX_CONF else if [[ -z "${PUSH_URLS}" ]]; then echo -e "Envvar PUSH_URLS required" @@ -42,7 +44,7 @@ else : NGINX_PUSH_URLS=$NGINX_PUSH_URLS$'push '$i$'\n' done - sed -i 's@___PUSH_DIRECTIVES___@'"$NGINX_PUSH_URLS"'@' nginx_restream.conf > $NGINX_CONF + sed -i 's@___PUSH_DIRECTIVES___@'"$NGINX_PUSH_URLS"'@' $NGINX_RESTREAM_CONF > $NGINX_CONF fi fi