From d349c2f9e2beec92357db535e223b374c5635ffc Mon Sep 17 00:00:00 2001 From: Robert Vogel Date: Mon, 17 Nov 2025 15:29:43 +0100 Subject: [PATCH] Allow DEV version builds This change allows developers to create a local image that contains special dev tools --- Dockerfile | 11 +++++++++++ root-fs/app/conf/99-bluespice-dev.ini | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 root-fs/app/conf/99-bluespice-dev.ini diff --git a/Dockerfile b/Dockerfile index e9bf441..748611e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,6 +84,8 @@ COPY ./root-fs/etc/php/8.x/fpm/pool.d/www.conf /etc/php$VERSION/php-fpm.d/ COPY ./root-fs/etc/nginx/nginx.conf /etc/nginx/nginx.conf ARG EDITION +ARG DEV=0 + RUN if [ -n "$EDITION" ]; then \ echo "EDITION=$EDITION" > /app/.env; \ fi @@ -101,6 +103,15 @@ RUN ln -sf /usr/sbin/php-fpm$VERSION /usr/bin/php-fpm \ && touch /app/.env \ && chown $USER:$GROUPNAME /app/.env \ && chmod 660 /app/.env + +RUN if [ "$DEV" -eq "1" ]; then \ + apk add --no-cache \ + php$VERSION-xdebug \ + iputils \ + curl \ + && ln -s /app/conf/99-bluespice-dev.ini /etc/php$VERSION/conf.d/99-bluespice-dev.ini \ + fi + FROM bluespice-prepare AS bluespice-final WORKDIR /app USER bluespice diff --git a/root-fs/app/conf/99-bluespice-dev.ini b/root-fs/app/conf/99-bluespice-dev.ini new file mode 100644 index 0000000..9878681 --- /dev/null +++ b/root-fs/app/conf/99-bluespice-dev.ini @@ -0,0 +1,17 @@ +# PHP ini for development +display_errors=on +display_startup_errors = On +error_reporting=E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING & ~E_USER_NOTICE & ~E_USER_DEPRECATED & ~E_USER_WARNING +error_log = /dev/stderr + +# Enable xdebug +xdebug.mode=develop,coverage,debug +# profile mode might bring a lot of /tmp/cachegrind.out.xxx +# when running for longer hours, it might eat up disk space +# enable profile mode only when needed +xdebug.idekey=VSCODE +xdebug.start_with_request=yes +xdebug.client_host=host.docker.internal +xdebug.client_port=9003 +xdebug.log=/dev/stdout +xdebug.log_level=0