Bump version and image, fixes #10

* alpine 3.5 to 3.13

	* openssl upgrade, remove MimeInfo and SSL perl pkg hacks

	* mysql client library upgrades (compatibility with 8)

	* image size reduction 703 to 322 MB

	* bump upstream sources for viewer and parser

	* introduce tags (current and latest docker image 1.0, old image
          still available as 0.5)
This commit is contained in:
Robert Schumann
2021-07-04 13:30:09 +02:00
parent 96a344f70a
commit c74bc90d20
6 changed files with 42 additions and 24 deletions

View File

@@ -2,13 +2,13 @@
# 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
sed -i -e "s/error_reporting =.*/error_reporting = E_ALL/g" /etc/php8/php.ini
sed -i -e "s/display_errors =.*/display_errors = stdout/g" /etc/php8/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
sed -i -e "s/zend_extension=opcache.so/;zend_extension=opcache.so/g" /etc/php8/conf.d/00_opcache.ini
fi
# Tweak nginx to match the workers to cpu's
@@ -16,9 +16,14 @@ procs=$(cat /proc/cpuinfo | grep processor | wc -l)
sed -i -e "s/worker_processes 5/worker_processes $procs/" /etc/nginx/nginx.conf
# Copy important env vars for PHP-FPM to access
PHP_ENV_FILE="/usr/etc/php-fpm.d/${PHP_ENV_FILE:-env.conf}"
PHP_ENV_FILE="/etc/php8/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"
echo 'user = nginx' >> "$PHP_ENV_FILE"
echo 'group = www-data' >> "$PHP_ENV_FILE"
env | grep -e 'REPORT_DB_HOST' -e 'REPORT_DB_PORT' -e 'REPORT_DB_NAME' -e 'REPORT_DB_USER' -e 'REPORT_DB_PASS' | sed "s/\(.*\)=\(.*\)/env[\1] = '\2'/" >> "$PHP_ENV_FILE"
# compat from older image where variable was not existing
grep -e ^REPORT_DB_PORT "$PHP_ENV_FILE" || echo env[REPORT_DB_PORT] = 3306 >> "$PHP_ENV_FILE"
# Start supervisord and services
/usr/bin/supervisord -n -c /etc/supervisord.conf

View File

@@ -12,6 +12,7 @@ $dbname = $ENV{'REPORT_DB_NAME'};
$dbuser = $ENV{'REPORT_DB_USER'};
$dbpass = $ENV{'REPORT_DB_PASS'};
$dbhost = $ENV{'REPORT_DB_HOST'}; # Set the hostname if we can't connect to the local socket.
$dbport = $ENV{'REPORT_DB_PORT'} || 3306;
if(exists $ENV{PARSER_IMAP_SERVER_WITH_PORT} && defined $ENV{PARSER_IMAP_SERVER_WITH_PORT}) {
my @server_attr = split ':', $ENV{PARSER_IMAP_SERVER_WITH_PORT};

View File

@@ -5,10 +5,10 @@
// ####################################################################
$dbhost=getenv('REPORT_DB_HOST');
$dbport=getenv('REPORT_DB_PORT');
$dbname=getenv('REPORT_DB_NAME');
$dbuser=getenv('REPORT_DB_USER');
$dbpass=getenv('REPORT_DB_PASS');
$dbport='3306';
$cssfile="default.css";