mirror of
https://github.com/librespeed/speedtest.git
synced 2026-07-10 18:43:54 +00:00
docker: simplify Alpine PHP ini install
This commit is contained in:
parent
a30872a4e8
commit
914a29de7a
1 changed files with 4 additions and 8 deletions
|
|
@ -20,19 +20,15 @@ RUN apk add --quiet --no-cache \
|
|||
RUN ln -sf /dev/stdout /var/log/apache2/access.log && \
|
||||
ln -sf /dev/stderr /var/log/apache2/error.log
|
||||
|
||||
# Alpine installs PHP from apk; php-apache2 reads /etc/phpXX/conf.d.
|
||||
# Use the versioned apk conf.d without pinning the PHP major.
|
||||
# Use PHP's scan dir without pinning the apk PHP major.
|
||||
COPY docker/librespeed-php.ini /tmp/librespeed-php.ini
|
||||
RUN set -eu; \
|
||||
scan_dir=""; \
|
||||
for d in /etc/php*/conf.d; do \
|
||||
[ -d "$d" ] && scan_dir="$d" && break; \
|
||||
done; \
|
||||
scan_dir="$(php -r 'echo rtrim(PHP_CONFIG_FILE_SCAN_DIR);')"; \
|
||||
if [ -z "$scan_dir" ]; then \
|
||||
echo "ERROR: no /etc/php*/conf.d directory found; apk php-apache2 install layout may have changed" >&2; \
|
||||
echo "ERROR: PHP_CONFIG_FILE_SCAN_DIR is empty" >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
install -D -m 0644 /tmp/librespeed-php.ini "$scan_dir/99-librespeed.ini"; \
|
||||
install -m 0644 /tmp/librespeed-php.ini "$scan_dir/99-librespeed.ini"; \
|
||||
rm /tmp/librespeed-php.ini
|
||||
|
||||
# Prepare files and folders
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue