diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e3f69e..6db7675 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,13 +23,13 @@ jobs: php: ["8.1", "8.2", "8.3", "8.4", "8.5"] variant: ["debian", "alpine"] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Login to DockerHub - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -70,11 +70,11 @@ jobs: matrix: php: ["7.2", "7.3", "7.4", "8.0"] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Login to DockerHub - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 480f547..f7b53e3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,9 +12,9 @@ jobs: php: ["8.1", "8.2", "8.3", "8.4", "8.5"] variant: ["debian", "alpine"] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Build Docker image uses: docker/build-push-action@v6 with: diff --git a/src/docker/Dockerfile b/src/docker/Dockerfile index c37c0b0..3e8c8ba 100644 --- a/src/docker/Dockerfile +++ b/src/docker/Dockerfile @@ -65,14 +65,7 @@ RUN set -eux; \ libxml2-dev libzip-dev zlib1g-dev; \ docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ docker-php-ext-install -j"$(nproc)" bcmath exif gd intl mbstring pcntl pdo_mysql pdo_pgsql zip; \ - # One extension per call with retries: pecl does not fail when one of several packages fails - for ext in redis memcached rdkafka; do \ - n=0; \ - until pecl install -f "$ext" && [ -f "$(php-config --extension-dir)/$ext.so" ]; do \ - n=$((n + 1)); [ "$n" -ge 3 ] && { echo "pecl install $ext failed"; exit 1; }; \ - sleep 10; \ - done; \ - done; \ + pecl install redis memcached rdkafka; \ docker-php-ext-enable redis memcached rdkafka; \ # OPcache is always compiled in since PHP 8.5 if ! php -m | grep -qi '^zend opcache$'; then docker-php-ext-install opcache; fi; \ diff --git a/src/docker/Dockerfile.alpine b/src/docker/Dockerfile.alpine index c51e18d..aad556c 100644 --- a/src/docker/Dockerfile.alpine +++ b/src/docker/Dockerfile.alpine @@ -51,14 +51,7 @@ RUN set -eux; \ libxml2-dev libzip-dev zlib-dev cyrus-sasl-dev linux-headers; \ docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ docker-php-ext-install -j"$(nproc)" bcmath exif gd intl mbstring pcntl pdo_mysql pdo_pgsql zip; \ - # One extension per call with retries: pecl does not fail when one of several packages fails - for ext in redis memcached rdkafka; do \ - n=0; \ - until pecl install -f "$ext" && [ -f "$(php-config --extension-dir)/$ext.so" ]; do \ - n=$((n + 1)); [ "$n" -ge 3 ] && { echo "pecl install $ext failed"; exit 1; }; \ - sleep 10; \ - done; \ - done; \ + pecl install redis memcached rdkafka; \ docker-php-ext-enable redis memcached rdkafka; \ # OPcache is always compiled in since PHP 8.5 if ! php -m | grep -qi '^zend opcache$'; then docker-php-ext-install opcache; fi; \ diff --git a/tests/integration.sh b/tests/integration.sh index 8f15c38..6021676 100755 --- a/tests/integration.sh +++ b/tests/integration.sh @@ -21,7 +21,7 @@ docker run --rm "$IMAGE" php -m > modules.txt for ext in bcmath exif gd intl mbstring memcached pcntl pdo_mysql pdo_pgsql rdkafka redis zip "Zend OPcache"; do grep -qx "$ext" modules.txt || { echo "Missing extension: $ext"; exit 1; } done -if docker run --rm "$IMAGE" sh -c 'php -m 2>&1' 2>/dev/null | grep -iE 'warning|unable to load'; then +if docker run --rm "$IMAGE" php -m 2>&1 | grep -iE 'warning|unable to load'; then echo "PHP startup warnings detected"; exit 1 fi rm -f modules.txt @@ -29,9 +29,7 @@ docker run --rm "$IMAGE" sh -c 'php -v && composer -V && node -v && npm -v' echo "==> Creating Laravel project" rm -rf laravel -# Older Laravel releases (for PHP 8.1/8.2) are flagged by security advisories; -# this throwaway test project only checks that the image can serve Laravel. -docker run --rm -v "$PWD:/app" -w /app -e COMPOSER_NO_SECURITY_BLOCKING=1 "$IMAGE" \ +docker run --rm -v "$PWD:/app" -w /app "$IMAGE" \ composer create-project --prefer-dist --no-interaction --no-progress laravel/laravel laravel docker run --rm -v "$PWD/laravel:/var/www/html" "$IMAGE" \ chown -R www-data:www-data storage bootstrap/cache database @@ -50,8 +48,7 @@ echo "==> Running migrations" docker exec --user www-data php-fpm php artisan migrate --force echo "==> Checking HTTP response" -# Request Nginx from inside the compose network so host port conflicts cannot interfere -code=$(docker exec php-fpm curl -s -o /dev/null -w '%{http_code}' http://nginx-server) +code=$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:$HTTP_PORT") echo "HTTP $code" [ "$code" = "200" ]