Merge branch 'feature/php-8.3' into 'master'
Bump to Alpine 3.19 and PHP 8.3. See merge request tt-rss/tt-rss!14
This commit is contained in:
commit
1b31e6fd5b
|
@ -1,17 +1,17 @@
|
||||||
ARG PROXY_REGISTRY
|
ARG PROXY_REGISTRY
|
||||||
FROM ${PROXY_REGISTRY}alpine:3.18
|
FROM ${PROXY_REGISTRY}alpine:3.19
|
||||||
EXPOSE 9000/tcp
|
EXPOSE 9000/tcp
|
||||||
|
|
||||||
ENV SCRIPT_ROOT=/opt/tt-rss
|
ENV SCRIPT_ROOT=/opt/tt-rss
|
||||||
ENV SRC_DIR=/src/tt-rss/
|
ENV SRC_DIR=/src/tt-rss/
|
||||||
|
|
||||||
RUN apk add --no-cache dcron php82 php82-fpm php82-phar php82-sockets php82-pecl-apcu \
|
RUN apk add --no-cache dcron php83 php83-fpm php83-phar php83-sockets php83-pecl-apcu \
|
||||||
php82-pdo php82-gd php82-pgsql php82-pdo_pgsql php82-xmlwriter php82-opcache \
|
php83-pdo php83-gd php83-pgsql php83-pdo_pgsql php83-xmlwriter php83-opcache \
|
||||||
php82-mbstring php82-intl php82-xml php82-curl php82-simplexml \
|
php83-mbstring php83-intl php83-xml php83-curl php83-simplexml \
|
||||||
php82-session php82-tokenizer php82-dom php82-fileinfo php82-ctype \
|
php83-session php83-tokenizer php83-dom php83-fileinfo php83-ctype \
|
||||||
php82-json php82-iconv php82-pcntl php82-posix php82-zip php82-exif \
|
php83-json php83-iconv php83-pcntl php83-posix php83-zip php83-exif \
|
||||||
php82-openssl git postgresql-client sudo php82-pecl-xdebug rsync tzdata && \
|
php83-openssl git postgresql-client sudo php83-pecl-xdebug rsync tzdata && \
|
||||||
sed -i 's/\(memory_limit =\) 128M/\1 256M/' /etc/php82/php.ini && \
|
sed -i 's/\(memory_limit =\) 128M/\1 256M/' /etc/php83/php.ini && \
|
||||||
sed -i -e 's/^listen = 127.0.0.1:9000/listen = 9000/' \
|
sed -i -e 's/^listen = 127.0.0.1:9000/listen = 9000/' \
|
||||||
-e 's/;\(clear_env\) = .*/\1 = no/i' \
|
-e 's/;\(clear_env\) = .*/\1 = no/i' \
|
||||||
-e 's/;\(pm.status_path = \/status\)/\1/i' \
|
-e 's/;\(pm.status_path = \/status\)/\1/i' \
|
||||||
|
@ -19,7 +19,7 @@ RUN apk add --no-cache dcron php82 php82-fpm php82-phar php82-sockets php82-pecl
|
||||||
-e 's/^\(user\|group\) = .*/\1 = app/i' \
|
-e 's/^\(user\|group\) = .*/\1 = app/i' \
|
||||||
-e 's/;\(php_admin_value\[error_log\]\) = .*/\1 = \/tmp\/error.log/' \
|
-e 's/;\(php_admin_value\[error_log\]\) = .*/\1 = \/tmp\/error.log/' \
|
||||||
-e 's/;\(php_admin_flag\[log_errors\]\) = .*/\1 = on/' \
|
-e 's/;\(php_admin_flag\[log_errors\]\) = .*/\1 = on/' \
|
||||||
/etc/php82/php-fpm.d/www.conf && \
|
/etc/php83/php-fpm.d/www.conf && \
|
||||||
mkdir -p /var/www ${SCRIPT_ROOT}/config.d
|
mkdir -p /var/www ${SCRIPT_ROOT}/config.d
|
||||||
|
|
||||||
ARG CI_COMMIT_BRANCH
|
ARG CI_COMMIT_BRANCH
|
||||||
|
@ -87,7 +87,7 @@ ENV TTRSS_DB_HOST="db"
|
||||||
ENV TTRSS_DB_PORT="5432"
|
ENV TTRSS_DB_PORT="5432"
|
||||||
|
|
||||||
ENV TTRSS_MYSQL_CHARSET="UTF8"
|
ENV TTRSS_MYSQL_CHARSET="UTF8"
|
||||||
ENV TTRSS_PHP_EXECUTABLE="/usr/bin/php82"
|
ENV TTRSS_PHP_EXECUTABLE="/usr/bin/php83"
|
||||||
ENV TTRSS_PLUGINS="auth_internal, note, nginx_xaccel"
|
ENV TTRSS_PLUGINS="auth_internal, note, nginx_xaccel"
|
||||||
|
|
||||||
CMD ${SCRIPT_ROOT}/startup.sh
|
CMD ${SCRIPT_ROOT}/startup.sh
|
||||||
|
|
|
@ -65,7 +65,7 @@ sudo -u app cp ${SCRIPT_ROOT}/config.docker.php $DST_DIR/config.php
|
||||||
chmod 644 $DST_DIR/config.php
|
chmod 644 $DST_DIR/config.php
|
||||||
|
|
||||||
chown -R $OWNER_UID:$OWNER_GID $DST_DIR \
|
chown -R $OWNER_UID:$OWNER_GID $DST_DIR \
|
||||||
/var/log/php82
|
/var/log/php83
|
||||||
|
|
||||||
if [ -z "$TTRSS_NO_STARTUP_PLUGIN_UPDATES" ]; then
|
if [ -z "$TTRSS_NO_STARTUP_PLUGIN_UPDATES" ]; then
|
||||||
echo updating all local plugins...
|
echo updating all local plugins...
|
||||||
|
@ -104,7 +104,7 @@ if [ ! -z "${TTRSS_XDEBUG_ENABLED}" ]; then
|
||||||
fi
|
fi
|
||||||
echo enabling xdebug with the following parameters:
|
echo enabling xdebug with the following parameters:
|
||||||
env | grep TTRSS_XDEBUG
|
env | grep TTRSS_XDEBUG
|
||||||
cat > /etc/php82/conf.d/50_xdebug.ini <<EOF
|
cat > /etc/php83/conf.d/50_xdebug.ini <<EOF
|
||||||
zend_extension=xdebug.so
|
zend_extension=xdebug.so
|
||||||
xdebug.mode=debug
|
xdebug.mode=debug
|
||||||
xdebug.start_with_request = yes
|
xdebug.start_with_request = yes
|
||||||
|
@ -114,17 +114,17 @@ EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i.bak "s/^\(memory_limit\) = \(.*\)/\1 = ${PHP_WORKER_MEMORY_LIMIT}/" \
|
sed -i.bak "s/^\(memory_limit\) = \(.*\)/\1 = ${PHP_WORKER_MEMORY_LIMIT}/" \
|
||||||
/etc/php82/php.ini
|
/etc/php83/php.ini
|
||||||
|
|
||||||
sed -i.bak "s/^\(pm.max_children\) = \(.*\)/\1 = ${PHP_WORKER_MAX_CHILDREN}/" \
|
sed -i.bak "s/^\(pm.max_children\) = \(.*\)/\1 = ${PHP_WORKER_MAX_CHILDREN}/" \
|
||||||
/etc/php82/php-fpm.d/www.conf
|
/etc/php83/php-fpm.d/www.conf
|
||||||
|
|
||||||
sudo -Eu app php82 $DST_DIR/update.php --update-schema=force-yes
|
sudo -Eu app php83 $DST_DIR/update.php --update-schema=force-yes
|
||||||
|
|
||||||
if [ ! -z "$ADMIN_USER_PASS" ]; then
|
if [ ! -z "$ADMIN_USER_PASS" ]; then
|
||||||
sudo -Eu app php82 $DST_DIR/update.php --user-set-password "admin:$ADMIN_USER_PASS"
|
sudo -Eu app php83 $DST_DIR/update.php --user-set-password "admin:$ADMIN_USER_PASS"
|
||||||
else
|
else
|
||||||
if sudo -Eu app php82 $DST_DIR/update.php --user-check-password "admin:password"; then
|
if sudo -Eu app php83 $DST_DIR/update.php --user-check-password "admin:password"; then
|
||||||
RANDOM_PASS=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 16 ; echo '')
|
RANDOM_PASS=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 16 ; echo '')
|
||||||
|
|
||||||
echo "*****************************************************************************"
|
echo "*****************************************************************************"
|
||||||
|
@ -132,21 +132,21 @@ else
|
||||||
echo "* If you want to set it manually, use ADMIN_USER_PASS environment variable. *"
|
echo "* If you want to set it manually, use ADMIN_USER_PASS environment variable. *"
|
||||||
echo "*****************************************************************************"
|
echo "*****************************************************************************"
|
||||||
|
|
||||||
sudo -Eu app php82 $DST_DIR/update.php --user-set-password "admin:$RANDOM_PASS"
|
sudo -Eu app php83 $DST_DIR/update.php --user-set-password "admin:$RANDOM_PASS"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$ADMIN_USER_ACCESS_LEVEL" ]; then
|
if [ ! -z "$ADMIN_USER_ACCESS_LEVEL" ]; then
|
||||||
sudo -Eu app php82 $DST_DIR/update.php --user-set-access-level "admin:$ADMIN_USER_ACCESS_LEVEL"
|
sudo -Eu app php83 $DST_DIR/update.php --user-set-access-level "admin:$ADMIN_USER_ACCESS_LEVEL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$AUTO_CREATE_USER" ]; then
|
if [ ! -z "$AUTO_CREATE_USER" ]; then
|
||||||
sudo -Eu app /bin/sh -c "php82 $DST_DIR/update.php --user-exists $AUTO_CREATE_USER ||
|
sudo -Eu app /bin/sh -c "php83 $DST_DIR/update.php --user-exists $AUTO_CREATE_USER ||
|
||||||
php82 $DST_DIR/update.php --force-yes --user-add \"$AUTO_CREATE_USER:$AUTO_CREATE_USER_PASS:$AUTO_CREATE_USER_ACCESS_LEVEL\""
|
php83 $DST_DIR/update.php --force-yes --user-add \"$AUTO_CREATE_USER:$AUTO_CREATE_USER_PASS:$AUTO_CREATE_USER_ACCESS_LEVEL\""
|
||||||
|
|
||||||
if [ ! -z "$AUTO_CREATE_USER_ENABLE_API" ]; then
|
if [ ! -z "$AUTO_CREATE_USER_ENABLE_API" ]; then
|
||||||
# TODO: remove || true later
|
# TODO: remove || true later
|
||||||
sudo -Eu app /bin/sh -c "php82 $DST_DIR/update.php --user-enable-api \"$AUTO_CREATE_USER:$AUTO_CREATE_USER_ENABLE_API\"" || true
|
sudo -Eu app /bin/sh -c "php83 $DST_DIR/update.php --user-enable-api \"$AUTO_CREATE_USER:$AUTO_CREATE_USER_ENABLE_API\"" || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@ -160,4 +160,4 @@ unset AUTO_CREATE_USER_PASS
|
||||||
|
|
||||||
touch $DST_DIR/.app_is_ready
|
touch $DST_DIR/.app_is_ready
|
||||||
|
|
||||||
exec /usr/sbin/php-fpm82 --nodaemonize --force-stderr
|
exec /usr/sbin/php-fpm83 --nodaemonize --force-stderr
|
||||||
|
|
|
@ -21,7 +21,7 @@ while ! pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER; do
|
||||||
done
|
done
|
||||||
|
|
||||||
sed -i.bak "s/^\(memory_limit\) = \(.*\)/\1 = ${PHP_WORKER_MEMORY_LIMIT}/" \
|
sed -i.bak "s/^\(memory_limit\) = \(.*\)/\1 = ${PHP_WORKER_MEMORY_LIMIT}/" \
|
||||||
/etc/php82/php.ini
|
/etc/php83/php.ini
|
||||||
|
|
||||||
DST_DIR=/var/www/html/tt-rss
|
DST_DIR=/var/www/html/tt-rss
|
||||||
|
|
||||||
|
@ -30,4 +30,4 @@ while [ ! -s $DST_DIR/config.php -a -e $DST_DIR/.app_is_ready ]; do
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
|
|
||||||
sudo -E -u app /usr/bin/php82 /var/www/html/tt-rss/update_daemon2.php
|
sudo -E -u app /usr/bin/php83 /var/www/html/tt-rss/update_daemon2.php
|
||||||
|
|
Loading…
Reference in New Issue