switch to php 8.1

testing-php81
Andrew Dolgov 2 years ago
parent 4ae13e8900
commit 165d2fdd6f
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A

@ -1,21 +1,21 @@
FROM alpine:3.14
FROM alpine:3.16
EXPOSE 9000/tcp
ENV SCRIPT_ROOT=/opt/tt-rss
RUN apk add --no-cache dcron php8 php8-fpm \
php8-pdo php8-gd php8-pgsql php8-pdo_pgsql \
php8-mbstring php8-intl php8-xml php8-curl \
php8-session php8-tokenizer php8-dom php8-fileinfo \
php8-json php8-iconv php8-pcntl php8-posix php8-zip php8-exif \
php8-openssl git postgresql-client sudo php8-pecl-xdebug rsync && \
sed -i 's/\(memory_limit =\) 128M/\1 256M/' /etc/php8/php.ini && \
RUN apk add --no-cache dcron php81 php81-fpm \
php81-pdo php81-gd php81-pgsql php81-pdo_pgsql \
php81-mbstring php81-intl php81-xml php81-curl \
php81-session php81-tokenizer php81-dom php81-fileinfo \
php81-json php81-iconv php81-pcntl php81-posix php81-zip php81-exif \
php81-openssl git postgresql-client sudo php81-pecl-xdebug rsync && \
sed -i 's/\(memory_limit =\) 128M/\1 256M/' /etc/php81/php.ini && \
sed -i -e 's/^listen = 127.0.0.1:9000/listen = 9000/' \
-e 's/;\(clear_env\) = .*/\1 = no/i' \
-e 's/^\(user\|group\) = .*/\1 = app/i' \
-e 's/;\(php_admin_value\[error_log\]\) = .*/\1 = \/tmp\/error.log/' \
-e 's/;\(php_admin_flag\[log_errors\]\) = .*/\1 = on/' \
/etc/php8/php-fpm.d/www.conf && \
/etc/php81/php-fpm.d/www.conf && \
mkdir -p /var/www ${SCRIPT_ROOT}/config.d
ADD startup.sh ${SCRIPT_ROOT}
@ -61,7 +61,7 @@ ENV TTRSS_DB_HOST="db"
ENV TTRSS_DB_PORT="5432"
ENV TTRSS_MYSQL_CHARSET="UTF8"
ENV TTRSS_PHP_EXECUTABLE="/usr/bin/php8"
ENV TTRSS_PHP_EXECUTABLE="/usr/bin/php81"
ENV TTRSS_PLUGINS="auth_internal, note, nginx_xaccel"
CMD ${SCRIPT_ROOT}/startup.sh

@ -90,7 +90,7 @@ for d in cache lock feed-icons; do
done
chown -R $OWNER_UID:$OWNER_GID $DST_DIR \
/var/log/php8
/var/log/php81
$PSQL -c "create extension if not exists pg_trgm"
@ -110,7 +110,7 @@ if [ ! -z "${TTRSS_XDEBUG_ENABLED}" ]; then
fi
echo enabling xdebug with the following parameters:
env | grep TTRSS_XDEBUG
cat > /etc/php8/conf.d/50_xdebug.ini <<EOF
cat > /etc/php81/conf.d/50_xdebug.ini <<EOF
zend_extension=xdebug.so
xdebug.mode=develop,trace,debug
xdebug.start_with_request = yes
@ -120,17 +120,17 @@ EOF
fi
sed -i.bak "s/^\(memory_limit\) = \(.*\)/\1 = ${PHP_WORKER_MEMORY_LIMIT}/" \
/etc/php8/php.ini
/etc/php81/php.ini
sed -i.bak "s/^\(pm.max_children\) = \(.*\)/\1 = ${PHP_WORKER_MAX_CHILDREN}/" \
/etc/php8/php-fpm.d/www.conf
/etc/php81/php-fpm.d/www.conf
sudo -Eu app php8 $DST_DIR/update.php --update-schema=force-yes
sudo -Eu app php81 $DST_DIR/update.php --update-schema=force-yes
if [ ! -z "$ADMIN_USER_PASS" ]; then
sudo -Eu app php8 $DST_DIR/update.php --user-set-password "admin:$ADMIN_USER_PASS"
sudo -Eu app php81 $DST_DIR/update.php --user-set-password "admin:$ADMIN_USER_PASS"
else
if sudo -Eu app php8 $DST_DIR/update.php --user-check-password "admin:password"; then
if sudo -Eu app php81 $DST_DIR/update.php --user-check-password "admin:password"; then
RANDOM_PASS=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 16 ; echo '')
echo "*****************************************************************************"
@ -138,17 +138,17 @@ else
echo "* If you want to set it manually, use ADMIN_USER_PASS environment variable. *"
echo "*****************************************************************************"
sudo -Eu app php8 $DST_DIR/update.php --user-set-password "admin:$RANDOM_PASS"
sudo -Eu app php81 $DST_DIR/update.php --user-set-password "admin:$RANDOM_PASS"
fi
fi
if [ ! -z "$ADMIN_USER_ACCESS_LEVEL" ]; then
sudo -Eu app php8 $DST_DIR/update.php --user-set-access-level "admin:$ADMIN_USER_ACCESS_LEVEL"
sudo -Eu app php81 $DST_DIR/update.php --user-set-access-level "admin:$ADMIN_USER_ACCESS_LEVEL"
fi
if [ ! -z "$AUTO_CREATE_USER" ]; then
sudo -Eu app /bin/sh -c "php8 $DST_DIR/update.php --user-exists $AUTO_CREATE_USER ||
php8 $DST_DIR/update.php --force-yes --user-add \"$AUTO_CREATE_USER:$AUTO_CREATE_USER_PASS:$AUTO_CREATE_USER_ACCESS_LEVEL\""
sudo -Eu app /bin/sh -c "php81 $DST_DIR/update.php --user-exists $AUTO_CREATE_USER ||
php81 $DST_DIR/update.php --force-yes --user-add \"$AUTO_CREATE_USER:$AUTO_CREATE_USER_PASS:$AUTO_CREATE_USER_ACCESS_LEVEL\""
fi
rm -f /tmp/error.log && mkfifo /tmp/error.log && chown app:app /tmp/error.log
@ -158,6 +158,9 @@ rm -f /tmp/error.log && mkfifo /tmp/error.log && chown app:app /tmp/error.log
unset ADMIN_USER_PASS
unset AUTO_CREATE_USER_PASS
# cleanup any old lockfiles
rm -vf -- /var/www/html/tt-rss/lock/*.lock
touch $DST_DIR/.app_is_ready
exec /usr/sbin/php-fpm8 --nodaemonize --force-stderr -R
exec /usr/sbin/php-fpm81 --nodaemonize --force-stderr -R

@ -26,7 +26,7 @@ while ! pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER; do
done
sed -i.bak "s/^\(memory_limit\) = \(.*\)/\1 = ${PHP_WORKER_MEMORY_LIMIT}/" \
/etc/php8/php.ini
/etc/php81/php.ini
DST_DIR=/var/www/html/tt-rss
@ -35,4 +35,4 @@ while [ ! -s $DST_DIR/config.php -a -e $DST_DIR/.app_is_ready ]; do
sleep 3
done
sudo -E -u app /usr/bin/php8 /var/www/html/tt-rss/update_daemon2.php
sudo -E -u app /usr/bin/php81 /var/www/html/tt-rss/update_daemon2.php

Loading…
Cancel
Save