copy nginx sample configs
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Torma Kristóf 2020-09-19 21:55:02 +02:00
parent 9197a0c108
commit fd182b6baf
2 changed files with 7 additions and 2 deletions

View File

@ -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"]

View File

@ -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