mirror of
https://github.com/librenms/docker.git
synced 2026-01-23 02:14:48 +00:00
Update to PHP 8 and Alpine Linux 3.16 (#289)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
a9e2bbf252
commit
fc9666248d
10 changed files with 52 additions and 52 deletions
|
|
@ -6,16 +6,16 @@ echo "Fixing perms..."
|
|||
mkdir -p /data \
|
||||
/var/run/nginx \
|
||||
/var/run/php-fpm
|
||||
chown librenms. \
|
||||
chown librenms:librenms \
|
||||
/data \
|
||||
"${LIBRENMS_PATH}" \
|
||||
"${LIBRENMS_PATH}/.env"
|
||||
chown -R librenms. \
|
||||
chown -R librenms:librenms \
|
||||
"${LIBRENMS_PATH}/html/plugins/Weathermap/output" \
|
||||
/home/librenms \
|
||||
/tpls \
|
||||
/var/lib/nginx \
|
||||
/var/log/nginx \
|
||||
/var/log/php7 \
|
||||
/var/log/php8 \
|
||||
/var/run/nginx \
|
||||
/var/run/php-fpm
|
||||
|
|
|
|||
|
|
@ -56,17 +56,17 @@ echo "Setting PHP-FPM configuration..."
|
|||
sed -e "s/@MEMORY_LIMIT@/$MEMORY_LIMIT/g" \
|
||||
-e "s/@UPLOAD_MAX_SIZE@/$UPLOAD_MAX_SIZE/g" \
|
||||
-e "s/@CLEAR_ENV@/$CLEAR_ENV/g" \
|
||||
/tpls/etc/php7/php-fpm.d/www.conf >/etc/php7/php-fpm.d/www.conf
|
||||
/tpls/etc/php8/php-fpm.d/www.conf >/etc/php8/php-fpm.d/www.conf
|
||||
|
||||
echo "Setting PHP INI configuration..."
|
||||
sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php7/php.ini
|
||||
sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php7/php.ini
|
||||
sed -i "s|;max_input_vars.*|max_input_vars = ${MAX_INPUT_VARS}|g" /etc/php7/php.ini
|
||||
sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php8/php.ini
|
||||
sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php8/php.ini
|
||||
sed -i "s|;max_input_vars.*|max_input_vars = ${MAX_INPUT_VARS}|g" /etc/php8/php.ini
|
||||
|
||||
# OpCache
|
||||
echo "Setting OpCache configuration..."
|
||||
sed -e "s/@OPCACHE_MEM_SIZE@/$OPCACHE_MEM_SIZE/g" \
|
||||
/tpls/etc/php7/conf.d/opcache.ini >/etc/php7/conf.d/opcache.ini
|
||||
/tpls/etc/php8/conf.d/opcache.ini >/etc/php8/conf.d/opcache.ini
|
||||
|
||||
# Nginx
|
||||
echo "Setting Nginx configuration..."
|
||||
|
|
@ -194,13 +194,13 @@ for plugin in ${plugins}; do
|
|||
rm -rf "${LIBRENMS_PATH}/html/plugins/${plugin}"
|
||||
fi
|
||||
ln -sf "/data/plugins/${plugin}" "${LIBRENMS_PATH}/html/plugins/${plugin}"
|
||||
chown -h librenms. "${LIBRENMS_PATH}/html/plugins/${plugin}"
|
||||
chown -h librenms:librenms "${LIBRENMS_PATH}/html/plugins/${plugin}"
|
||||
done
|
||||
|
||||
# Fix perms
|
||||
echo "Fixing perms..."
|
||||
chown librenms. /data/config /data/monitoring-plugins /data/plugins /data/rrd /data/weathermap /data/alert-templates
|
||||
chown -R librenms. /data/logs ${LIBRENMS_PATH}/config.d ${LIBRENMS_PATH}/bootstrap ${LIBRENMS_PATH}/logs ${LIBRENMS_PATH}/storage
|
||||
chown librenms:librenms /data/config /data/monitoring-plugins /data/plugins /data/rrd /data/weathermap /data/alert-templates
|
||||
chown -R librenms:librenms /data/logs ${LIBRENMS_PATH}/config.d ${LIBRENMS_PATH}/bootstrap ${LIBRENMS_PATH}/logs ${LIBRENMS_PATH}/storage
|
||||
chmod ug+rw /data/logs /data/rrd ${LIBRENMS_PATH}/bootstrap/cache ${LIBRENMS_PATH}/storage ${LIBRENMS_PATH}/storage/framework/*
|
||||
|
||||
# Check additional Monitoring plugins
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ NODE_ID=$(php -r "echo uniqid();")
|
|||
EOL
|
||||
fi
|
||||
cat "/data/.env" >>"${LIBRENMS_PATH}/.env"
|
||||
chown librenms. /data/.env "${LIBRENMS_PATH}/.env"
|
||||
chown librenms:librenms /data/.env "${LIBRENMS_PATH}/.env"
|
||||
|
||||
file_env 'DB_PASSWORD'
|
||||
if [ -z "$DB_PASSWORD" ]; then
|
||||
|
|
@ -98,7 +98,7 @@ cat >/etc/services.d/php-fpm/run <<EOL
|
|||
#!/usr/bin/execlineb -P
|
||||
with-contenv
|
||||
s6-setuidgid ${PUID}:${PGID}
|
||||
php-fpm7 -F
|
||||
php-fpm8 -F
|
||||
EOL
|
||||
chmod +x /etc/services.d/php-fpm/run
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ echo ">> Sidecar syslog-ng container detected"
|
|||
echo ">>"
|
||||
|
||||
mkdir -p /data/syslog-ng /run/syslog-ng
|
||||
chown librenms. /data/syslog-ng
|
||||
chown -R librenms. /run/syslog-ng
|
||||
chown librenms:librenms /data/syslog-ng
|
||||
chown -R librenms:librenms /run/syslog-ng
|
||||
|
||||
# Create service
|
||||
mkdir -p /etc/services.d/syslogng
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ echo ">> Sidecar snmptrapd container detected"
|
|||
echo ">>"
|
||||
|
||||
mkdir -p /run/snmptrapd
|
||||
chown -R librenms. /run/snmptrapd
|
||||
chown -R librenms:librenms /run/snmptrapd
|
||||
|
||||
sed -ie "s/@LIBRENMS_SNMP_COMMUNITY@/${LIBRENMS_SNMP_COMMUNITY}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_PROCESSING_TYPE@/${SNMP_PROCESSING_TYPE}/" /etc/snmp/snmptrapd.conf
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@version:3.30
|
||||
@version:3.36
|
||||
|
||||
options {
|
||||
chain_hostnames(off);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ http {
|
|||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $path_info;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_pass unix:/var/run/php-fpm/php-fpm7.sock;
|
||||
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
|
||||
fastcgi_buffers 256 4k;
|
||||
fastcgi_buffer_size 32k;
|
||||
fastcgi_intercept_errors on;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
[global]
|
||||
pid = /var/run/php-fpm/php-fpm7.pid
|
||||
pid = /var/run/php-fpm/php-fpm.pid
|
||||
daemonize = no
|
||||
error_log = /proc/self/fd/2
|
||||
|
||||
[www]
|
||||
listen = /var/run/php-fpm/php-fpm7.sock
|
||||
listen = /var/run/php-fpm/php-fpm.sock
|
||||
access.log = /dev/null
|
||||
|
||||
pm = dynamic
|
||||
Loading…
Add table
Add a link
Reference in a new issue