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:
18
start.sh
18
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
|
||||
|
||||
# Very dirty hack to replace variables in code with ENVIRONMENT values
|
||||
|
||||
for i in $(env)
|
||||
do
|
||||
variable=$(echo "$i" | cut -d'=' -f1)
|
||||
value=$(echo "$i" | cut -d'=' -f2)
|
||||
if [[ "$variable" != '%s' ]] ; then
|
||||
replace='\$\$_'${variable}'_\$\$'
|
||||
find /usr/share/nginx/html -type f -exec sed -i -e 's/'${replace}'/'${value}'/g' {} \; ; fi
|
||||
if [[ "$TEMPLATE_NGINX_HTML" != "0" ]] ; then
|
||||
for i in $(env)
|
||||
do
|
||||
variable=$(echo "$i" | cut -d'=' -f1)
|
||||
value=$(echo "$i" | cut -d'=' -f2)
|
||||
if [[ "$variable" != '%s' ]] ; then
|
||||
replace='\$\$_'${variable}'_\$\$'
|
||||
find /usr/share/nginx/html -type f -exec sed -i -e 's/'${replace}'/'${value}'/g' {} \;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Start supervisord and services
|
||||
/usr/local/bin/supervisord -n
|
||||
|
||||
Reference in New Issue
Block a user