From ff79f7967972d743a069c28d91ea40f2c14bd58b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 5 Mar 2021 13:56:10 +0300 Subject: [PATCH] reduce amount of layers when building --- src/app/Dockerfile | 27 +++++++++++++++------------ src/app/startup.sh | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/app/Dockerfile b/src/app/Dockerfile index 53c3fba..40293ee 100644 --- a/src/app/Dockerfile +++ b/src/app/Dockerfile @@ -1,16 +1,18 @@ FROM alpine:3.13 EXPOSE 9000/tcp -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-openssl \ - git postgresql-client sudo rsync - ENV SCRIPT_ROOT=/opt/tt-rss -RUN mkdir -p /var/www ${SCRIPT_ROOT}/config.d +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-openssl git postgresql-client sudo php8-pecl-xdebug rsync && \ + sed -i.bak 's/^listen = 127.0.0.1:9000/listen = 9000/' /etc/php8/php-fpm.d/www.conf && \ + sed -i.bak 's/\(memory_limit =\) 128M/\1 256M/' /etc/php8/php.ini && \ + sed -i.bak 's/;clear_env = .*/clear_env = no/i' /etc/php8/php-fpm.d/www.conf && \ + mkdir -p /var/www ${SCRIPT_ROOT}/config.d ADD startup.sh ${SCRIPT_ROOT} ADD updater.sh ${SCRIPT_ROOT} @@ -20,15 +22,16 @@ ADD backup.sh /etc/periodic/weekly/backup ADD config.docker.php ${SCRIPT_ROOT} ADD build-prepare.sh ${SCRIPT_ROOT} -RUN sed -i.bak 's/^listen = 127.0.0.1:9000/listen = 9000/' /etc/php8/php-fpm.d/www.conf -RUN sed -i.bak 's/\(memory_limit =\) 128M/\1 256M/' /etc/php8/php.ini -RUN sed -i.bak 's/;clear_env = .*/clear_env = no/i' /etc/php8/php-fpm.d/www.conf - RUN sh -c ${SCRIPT_ROOT}/build-prepare.sh ENV OWNER_UID=1000 ENV OWNER_GID=1000 +# TTRSS_XDEBUG_HOST defaults to host IP if unset +ENV TTRSS_XDEBUG_ENABLED="" +ENV TTRSS_XDEBUG_HOST="" +ENV TTRSS_XDEBUG_PORT="9000" + ENV TTRSS_DB_TYPE="pgsql" ENV TTRSS_DB_HOST="db" ENV TTRSS_DB_PORT="5432" diff --git a/src/app/startup.sh b/src/app/startup.sh index a5a744b..4db24db 100755 --- a/src/app/startup.sh +++ b/src/app/startup.sh @@ -69,6 +69,21 @@ fi # this was previously generated rm -f $DST_DIR/config.php.bak +if [ ! -z "${TTRSS_XDEBUG_ENABLED}" ]; then + if [ -z "${TTRSS_XDEBUG_HOST}" ]; then + export TTRSS_XDEBUG_HOST=$(ip ro sh 0/0 | cut -d " " -f 3) + fi + echo enabling xdebug with the following parameters: + env | grep TTRSS_XDEBUG + cat > /etc/php8/conf.d/50_xdebug.ini <