add optional support for xdebug

mariadb-unsupported
Andrew Dolgov 4 years ago
parent 75d1291976
commit c03e0f65e7

1
.gitignore vendored

@ -1,2 +1,3 @@
.env .env
config.d/*php
docker-compose.override.yml docker-compose.override.yml

@ -6,7 +6,7 @@ RUN apk add --no-cache dcron php8 php8-fpm \
php8-intl php8-xml php8-curl php8-session \ php8-intl php8-xml php8-curl php8-session \
php8-dom php8-fileinfo php8-json php8-iconv \ php8-dom php8-fileinfo php8-json php8-iconv \
php8-pcntl php8-posix php8-zip php8-openssl \ php8-pcntl php8-posix php8-zip php8-openssl \
git postgresql-client sudo git postgresql-client sudo php8-pecl-xdebug
ENV SCRIPT_ROOT=/opt/tt-rss ENV SCRIPT_ROOT=/opt/tt-rss
@ -26,6 +26,10 @@ RUN sed -i.bak 's/;clear_env = .*/clear_env = no/i' /etc/php8/php-fpm.d/www.conf
ENV OWNER_UID=1000 ENV OWNER_UID=1000
ENV OWNER_GID=1000 ENV OWNER_GID=1000
ENV TTRSS_XDEBUG_ENABLED=""
ENV TTRSS_XDEBUG_HOST=""
ENV TTRSS_XDEBUG_PORT=""
ENV TTRSS_DB_TYPE="pgsql" ENV TTRSS_DB_TYPE="pgsql"
ENV TTRSS_DB_HOST="db" ENV TTRSS_DB_HOST="db"
ENV TTRSS_DB_USER="%DB_USER" ENV TTRSS_DB_USER="%DB_USER"

@ -77,6 +77,18 @@ cp ${SCRIPT_ROOT}/config.docker.php $DST_DIR/config.php
# this was previously generated # this was previously generated
rm -f $DST_DIR/config.php.bak rm -f $DST_DIR/config.php.bak
if [ ! -z "${TTRSS_XDEBUG_ENABLED}" ]; then
echo enabling xdebug with the following parameters:
env | grep TTRSS_XDEBUG
cat > /etc/php8/conf.d/50_xdebug.ini <<EOF
zend_extension=xdebug.so
xdebug.mode=develop,trace,debug
xdebug.start_with_request = yes
xdebug.client_port = ${TTRSS_XDEBUG_PORT}
xdebug.client_host = ${TTRSS_XDEBUG_HOST}
EOF
fi
cd $DST_DIR && sudo -E -u app php8 ./update.php --update-schema=force-yes cd $DST_DIR && sudo -E -u app php8 ./update.php --update-schema=force-yes
touch $DST_DIR/.app_is_ready touch $DST_DIR/.app_is_ready

Loading…
Cancel
Save