From b29de3eb7cc9a10f9fd5bd044e31bd28f9744b8f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 22 May 2025 14:05:24 +0300 Subject: add APP_WEB_ROOT to fpm container --- .docker/app/Dockerfile | 1 + .docker/app/backup.sh | 2 +- .docker/app/startup.sh | 6 +++--- .docker/app/updater.sh | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to '.docker/app') diff --git a/.docker/app/Dockerfile b/.docker/app/Dockerfile index 786179bd5..553f397e6 100644 --- a/.docker/app/Dockerfile +++ b/.docker/app/Dockerfile @@ -7,6 +7,7 @@ ARG ALPINE_MIRROR ENV SCRIPT_ROOT=/opt/tt-rss ENV SRC_DIR=/src/tt-rss/ +ENV APP_WEB_ROOT=/var/www/html # Used to centralize the PHP version suffix for packages and paths ENV PHP_SUFFIX=84 diff --git a/.docker/app/backup.sh b/.docker/app/backup.sh index 4ecc860b9..f35a5086b 100644 --- a/.docker/app/backup.sh +++ b/.docker/app/backup.sh @@ -2,7 +2,7 @@ DST_DIR=/backups KEEP_DAYS=28 -APP_ROOT=/var/www/html/tt-rss +APP_ROOT=$APP_WEB_ROOT/tt-rss if pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER -p $TTRSS_DB_PORT; then DST_FILE=ttrss-backup-$(date +%Y%m%d).sql.gz diff --git a/.docker/app/startup.sh b/.docker/app/startup.sh index cf93b7413..3085edaf7 100644 --- a/.docker/app/startup.sh +++ b/.docker/app/startup.sh @@ -11,18 +11,18 @@ unset HTTP_HOST if ! id app >/dev/null 2>&1; then addgroup -g $OWNER_GID app - adduser -D -h /var/www/html -G app -u $OWNER_UID app + adduser -D -h $APP_WEB_ROOT -G app -u $OWNER_UID app fi update-ca-certificates || true -DST_DIR=/var/www/html/tt-rss +DST_DIR=$APP_WEB_ROOT/tt-rss [ -e $DST_DIR ] && rm -f $DST_DIR/.app_is_ready export PGPASSWORD=$TTRSS_DB_PASS -[ ! -e /var/www/html/index.php ] && cp ${SCRIPT_ROOT}/index.php /var/www/html +[ ! -e $APP_WEB_ROOT/index.php ] && cp ${SCRIPT_ROOT}/index.php $APP_WEB_ROOT if [ -z $SKIP_RSYNC_ON_STARTUP ]; then if [ ! -d $DST_DIR ]; then diff --git a/.docker/app/updater.sh b/.docker/app/updater.sh index c35982a44..782d52ca5 100644 --- a/.docker/app/updater.sh +++ b/.docker/app/updater.sh @@ -12,7 +12,7 @@ sleep 30 if ! id app; then addgroup -g $OWNER_GID app - adduser -D -h /var/www/html -G app -u $OWNER_UID app + adduser -D -h $APP_WEB_ROOT -G app -u $OWNER_UID app fi while ! pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER -p $TTRSS_DB_PORT; do @@ -23,11 +23,11 @@ done sed -i.bak "s/^\(memory_limit\) = \(.*\)/\1 = ${PHP_WORKER_MEMORY_LIMIT}/" \ /etc/php${PHP_SUFFIX}/php.ini -DST_DIR=/var/www/html/tt-rss +DST_DIR=$APP_WEB_ROOT/tt-rss while [ ! -s $DST_DIR/config.php -a -e $DST_DIR/.app_is_ready ]; do echo waiting for app container... sleep 3 done -sudo -E -u app "${TTRSS_PHP_EXECUTABLE}" /var/www/html/tt-rss/update_daemon2.php "$@" +sudo -E -u app "${TTRSS_PHP_EXECUTABLE}" $APP_WEB_ROOT/tt-rss/update_daemon2.php "$@" -- cgit v1.2.3-54-g00ecf