From c03e0f65e7027920955324f197082eb8055cdf3b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 22 Feb 2021 12:13:20 +0300 Subject: [PATCH] add optional support for xdebug --- .gitignore | 1 + app/Dockerfile | 6 +++++- app/startup.sh | 12 ++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b8865ed..07bbaf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .env +config.d/*php docker-compose.override.yml diff --git a/app/Dockerfile b/app/Dockerfile index 795b8a6..93a9b0e 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -6,7 +6,7 @@ RUN apk add --no-cache dcron php8 php8-fpm \ php8-intl php8-xml php8-curl php8-session \ php8-dom php8-fileinfo php8-json php8-iconv \ 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 @@ -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_GID=1000 +ENV TTRSS_XDEBUG_ENABLED="" +ENV TTRSS_XDEBUG_HOST="" +ENV TTRSS_XDEBUG_PORT="" + ENV TTRSS_DB_TYPE="pgsql" ENV TTRSS_DB_HOST="db" ENV TTRSS_DB_USER="%DB_USER" diff --git a/app/startup.sh b/app/startup.sh index d54a2c8..ae2ee4c 100755 --- a/app/startup.sh +++ b/app/startup.sh @@ -77,6 +77,18 @@ cp ${SCRIPT_ROOT}/config.docker.php $DST_DIR/config.php # this was previously generated 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 <