010lamp: clear opcache on container startup

- Dockerfile: Set apache configuration environment variables
- library.sh: Only retry setting up notify_push on failure

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
Tobias Knöppler 2023-01-20 01:10:05 +01:00
parent 56e1ff45ee
commit 41a7b6b373
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
3 changed files with 9 additions and 2 deletions

View File

@ -28,6 +28,12 @@ LABEL maintainer="Ignacio Núñez Hernanz <nacho@ownyourbits.com>"
SHELL ["/bin/bash", "-c"]
ENV DOCKERBUILD 1
ENV APACHE_RUN_USER=www-data
ENV APACHE_RUN_GROUP=www-data
ENV APACHE_LOG_DIR=/var/log/apache2
ENV APACHE_LOCK_DIR=/var/lock/apache2
ENV APACHE_PID_FILE=/var/run/apache2.pid
ENV APACHE_RUN_DIR=/var/run/apache2
COPY etc/ncp.cfg etc/library.sh lamp.sh /usr/local/etc/
COPY etc/ncp-templates /usr/local/etc/ncp-templates
@ -147,7 +153,7 @@ COPY etc/ncp-config.d/nc-init.cfg /usr/local/etc/ncp-config.d/nc-init-copy.cfg
COPY etc/ncp-config.d/nc-datadir.cfg /usr/local/etc/ncp-config.d/nc-datadir-copy.cfg
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
set -e; \
set -ex; \
# make sure we don't accidentally disable first run wizard
rm -f ncp-web/{wizard.cfg,ncp-web.cfg}; \

View File

@ -26,6 +26,7 @@ if [[ -f /usr/local/bin/ncp-docker-hook ]]; then
fi
echo "Starting PHP-fpm"
clear_opcache
php-fpm"${PHPVER}"
echo "Starting Apache"

View File

@ -162,7 +162,7 @@ function set-nc-domain()
for try in {1..5}
do
echo "Setup notify_push (attempt ${try}/5)"
ncc notify_push:setup "${url}/push"
ncc notify_push:setup "${url}/push" && break
sleep 10
done
fi