Allow skipping the templating
When you have a large code base, the templating can take some time. This allows you to skip it if you have no interest in it. Maybe a more sane default would be to disable it unless explicitly activated, but that would be backwards incompatible.
This commit is contained in:
6
start.sh
6
start.sh
@@ -22,15 +22,17 @@ procs=$(cat /proc/cpuinfo |grep processor | wc -l)
|
|||||||
sed -i -e "s/worker_processes 5/worker_processes $procs/" /etc/nginx/nginx.conf
|
sed -i -e "s/worker_processes 5/worker_processes $procs/" /etc/nginx/nginx.conf
|
||||||
|
|
||||||
# Very dirty hack to replace variables in code with ENVIRONMENT values
|
# Very dirty hack to replace variables in code with ENVIRONMENT values
|
||||||
|
if [[ "$TEMPLATE_NGINX_HTML" != "0" ]] ; then
|
||||||
for i in $(env)
|
for i in $(env)
|
||||||
do
|
do
|
||||||
variable=$(echo "$i" | cut -d'=' -f1)
|
variable=$(echo "$i" | cut -d'=' -f1)
|
||||||
value=$(echo "$i" | cut -d'=' -f2)
|
value=$(echo "$i" | cut -d'=' -f2)
|
||||||
if [[ "$variable" != '%s' ]] ; then
|
if [[ "$variable" != '%s' ]] ; then
|
||||||
replace='\$\$_'${variable}'_\$\$'
|
replace='\$\$_'${variable}'_\$\$'
|
||||||
find /usr/share/nginx/html -type f -exec sed -i -e 's/'${replace}'/'${value}'/g' {} \; ; fi
|
find /usr/share/nginx/html -type f -exec sed -i -e 's/'${replace}'/'${value}'/g' {} \;
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Start supervisord and services
|
# Start supervisord and services
|
||||||
/usr/local/bin/supervisord -n
|
/usr/local/bin/supervisord -n
|
||||||
|
|||||||
Reference in New Issue
Block a user