2020-03-03 00:29:52 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2020-06-22 13:06:54 +02:00
|
|
|
# Process the nginx template
|
|
|
|
SOURCE_FILE="/etc/nginx/conf.d/peertube.template"
|
|
|
|
TARGET_FILE="/etc/nginx/conf.d/default.conf"
|
2020-12-30 16:53:11 +01:00
|
|
|
export WEBSERVER_HOST="$PEERTUBE_WEBSERVER_HOSTNAME"
|
2020-03-03 00:29:52 +01:00
|
|
|
export PEERTUBE_HOST="peertube:9000"
|
|
|
|
|
2020-06-22 13:06:54 +02:00
|
|
|
envsubst '${WEBSERVER_HOST} ${PEERTUBE_HOST}' < $SOURCE_FILE > $TARGET_FILE
|
2020-03-03 00:29:52 +01:00
|
|
|
|
2020-12-30 16:53:11 +01:00
|
|
|
while :; do
|
|
|
|
sleep 12h & wait $!;
|
|
|
|
nginx -s reload;
|
|
|
|
done &
|
2020-03-03 00:29:52 +01:00
|
|
|
|
2020-12-30 16:53:11 +01:00
|
|
|
nginx -g 'daemon off;'
|