Skip to content

Commit

Permalink
php 8.2.22 and alpine 3.20.3 (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
en-jschuetze authored Sep 9, 2024
1 parent 99b2769 commit c327ba1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.19.4
FROM alpine:3.20.3

ARG PHP_VERSION="8.2.20"
ARG PHP_VERSION="8.2.22"
ARG PHP_PACKAGE_BASENAME="php82"
ARG PHP_FPM_BINARY_PATH="/usr/sbin/php-fpm82"
ARG UNIT_VERSION="1.32.1"
Expand Down Expand Up @@ -84,6 +84,19 @@ RUN apk add --no-cache ${PHP_PACKAGE_BASENAME}-zip
RUN apk add --no-cache ${PHP_PACKAGE_BASENAME}-pecl-grpc
RUN apk add --no-cache ${PHP_PACKAGE_BASENAME}-pecl-pcov

# FIXME: we need this, since php82 is not the _default_php in https://git.alpinelinux.org/aports/tree/community/php82/APKBUILD
WORKDIR /usr/bin
RUN ln -s php82 php \
&& ln -s peardev82 peardev \
&& ln -s pecl82 pecl \
&& ln -s phpize82 phpize \
&& ln -s php-config82 php-config \
&& ln -s phpdbg82 phpdbg \
&& ln -s lsphp82 lsphp \
&& ln -s php-cgi82 php-cgi \
&& ln -s phar.phar82 phar.phar \
&& ln -s phar82 phar

# add php.ini containing environment variables
COPY files/php.ini /etc/${PHP_PACKAGE_BASENAME}/php.ini

Expand Down Expand Up @@ -117,6 +130,8 @@ RUN echo "php_admin_flag[fastcgi.logging] = off" >> /etc/${PHP_PACKAGE_BASENAME}
RUN apk add --no-cache unit~=$UNIT_VERSION unit-${PHP_PACKAGE_BASENAME}~=$UNIT_VERSION
# add default nginx unit json file (listening on port 8080)
COPY files/unit/unit-default.json /var/lib/unit/conf.json
# create folder for socket (necessary since alpine 3.20)
RUN mkdir /run/unit/
# chown the folder for control socket file
RUN chown www-data:www-data /run/unit/

Expand Down
6 changes: 3 additions & 3 deletions tests/test_fpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -e

cd fpm
docker-compose down
docker-compose up -d php-fpm nginx
docker compose down
docker compose up -d php-fpm nginx

docker compose exec php-fpm bash -c 'wget nginx:8080/index.php -q -O /tmp/response && cat /tmp/response' | grep "IT WORKS IN NGINX PHP-FPM" > /dev/null
docker compose exec php-fpm bash -c 'wget nginx:8080/ -q -O /tmp/response && cat /tmp/response' | grep "IT WORKS IN NGINX PHP-FPM" > /dev/null
Expand All @@ -21,4 +21,4 @@ fi

docker compose exec php-fpm bash -c 'wget nginx:8080/phpinfo.php -q -O /tmp/response && cat /tmp/response' | grep "VARIABLE_NECESSARY_FOR_TEST" > /dev/null

#docker-compose down
#docker compose down

0 comments on commit c327ba1

Please sign in to comment.