25 lines
945 B
Bash
Raw Normal View History

2019-01-04 11:24:22 -08:00
#!/usr/bin/env bash
2018-03-31 19:35:32 +02:00
# Display PHP error's or not
if [[ "$ERRORS" != "1" ]] ; then
sed -i -e "s/error_reporting =.*=/error_reporting = E_ALL/g" /usr/etc/php.ini
sed -i -e "s/display_errors =.*/display_errors = stdout/g" /usr/etc/php.ini
fi
# Disable opcache?
if [[ -v NO_OPCACHE ]]; then
sed -i -e "s/zend_extension=opcache.so/;zend_extension=opcache.so/g" /etc/php.d/zend-opcache.ini
fi
# Tweak nginx to match the workers to cpu's
procs=$(cat /proc/cpuinfo | grep processor | wc -l)
sed -i -e "s/worker_processes 5/worker_processes $procs/" /etc/nginx/nginx.conf
2019-01-03 19:09:22 -08:00
# Copy important env vars for PHP-FPM to access
PHP_ENV_FILE="/usr/etc/php-fpm.d/${PHP_ENV_FILE:-env.conf}"
echo '[www]' > "$PHP_ENV_FILE"
env | grep -e 'REPORT_DB_HOST' -e 'REPORT_DB_NAME' -e 'REPORT_DB_USER' -e 'REPORT_DB_PASS' | sed "s/\(.*\)=\(.*\)/env[\1]='\2'/" >> "$PHP_ENV_FILE"
2018-03-31 19:35:32 +02:00
# Start supervisord and services
/usr/bin/supervisord -n -c /etc/supervisord.conf