diff --git a/.github/workflows/sylius-frankenphp.yml b/.github/workflows/sylius-frankenphp.yml new file mode 100644 index 0000000..7af7093 --- /dev/null +++ b/.github/workflows/sylius-frankenphp.yml @@ -0,0 +1,238 @@ +name: FrankenPHP Docker Image CI for Sylius + +on: + workflow_dispatch: ~ + push: + branches: [ main, frankenphp ] + paths: + - 'frankenphp/**' + - 'WORKSPACE' + schedule: + - cron: '0 20 * * 5' + +concurrency: + group: sylius_frankenphp_build + cancel-in-progress: false + +jobs: + build: + name: "Sylius FrankenPHP - ${{ matrix.frankenphp }}${{ matrix.php }} ${{ matrix.distro }}" + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + frankenphp: [ "1.5-php" ] + php: [ "8.2", "8.3", "8.4" ] + distro: [ "alpine" ] + + steps: + - uses: actions/checkout@v4 + + - name: Generate UUID + id: generate-uuid + run: | + UUID=$(cat /proc/sys/kernel/random/uuid) + echo "UUID=${UUID}" >> $GITHUB_OUTPUT + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ vars.DOCKER_FRANKENPHP_REPOSITORY_NAME }} + tags: | + type=raw,value=${{ matrix.frankenphp }}${{ matrix.php }}-${{ matrix.distro }} + labels: | + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.description=Sylius FrankenPHP ${{ matrix.frankenphp }}${{ matrix.php }} Docker image + org.opencontainers.image.licenses=MIT + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Cache Docker layers + uses: actions/cache@v4 + with: + path: /tmp/.buildx-cache + key: "${{ runner.os }}-frankenphp-${{ matrix.frankenphp }}${{ matrix.php }}-${{ matrix.distro }}-buildx-cache-${{ vars.CACHE_VERSION }}-${{ steps.generate-uuid.outputs.uuid }}" + # https://github.com/actions/cache/issues/109#issuecomment-558771281 + # https://github.community/t/always-save-new-cache-for-incremental-builds/172791 + restore-keys: "${{ runner.os }}-frankenphp-${{ matrix.frankenphp }}${{ matrix.php }}-${{ matrix.distro }}-buildx-cache-${{ vars.CACHE_VERSION }}-" + + - name: Docker Login + uses: docker/login-action@v3 + with: + registry: ${{ secrets.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_REPOSITORY_LOGIN }} + password: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }} + logout: true + + - name: Build multiplatform + uses: docker/build-push-action@v5 + with: + file: ./frankenphp/Dockerfile + context: ./frankenphp + build-args: "FRANKENPHP_VERSION=${{ matrix.frankenphp }}${{ matrix.php }}-${{ matrix.distro }}" + platforms: linux/amd64,linux/arm64 + push: false + pull: true + tags: ${{ steps.meta.outputs.tags }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new + + - name: Build linux/amd64 to tar + uses: docker/build-push-action@v5 + with: + file: ./frankenphp/Dockerfile + context: ./frankenphp + build-args: "FRANKENPHP_VERSION=${{ matrix.frankenphp }}${{ matrix.php }}-${{ matrix.distro }}" + platforms: linux/amd64 + push: false + pull: false + tags: ${{ steps.meta.outputs.tags }} + cache-from: type=local,src=/tmp/.buildx-cache-new + cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new-amd64 + outputs: type=docker,dest=./external/image-amd64.tar + + - name: Build linux/arm64 to tar + uses: docker/build-push-action@v5 + with: + file: ./frankenphp/Dockerfile + context: ./frankenphp + build-args: "FRANKENPHP_VERSION=${{ matrix.frankenphp }}${{ matrix.php }}-${{ matrix.distro }}" + platforms: linux/arm64 + push: false + pull: false + tags: ${{ steps.meta.outputs.tags }} + cache-from: type=local,src=/tmp/.buildx-cache-new + cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new-arm64 + outputs: type=docker,dest=./external/image-arm64.tar + + - name: Mount Bazel cache + uses: actions/cache@v4 + with: + path: "~/.cache/bazel" + key: "${{ runner.os }}-frankenphp-${{ matrix.frankenphp }}${{ matrix.php }}-${{ matrix.distro }}-bazel-cache-${{ vars.CACHE_VERSION }}-${{ steps.generate-uuid.outputs.uuid }}" + restore-keys: "${{ runner.os }}-frankenphp-${{ matrix.frankenphp }}${{ matrix.php }}-${{ matrix.distro }}-bazel-cache-${{ vars.CACHE_VERSION }}-" + + - name: Setup PHP for Bazel + run: | + set -ex + cat > frankenphp/php-version.bzl < frankenphp/frankenphp-arch.bzl <> $GITHUB_OUTPUT + + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v3 + + - name: Available platforms + run: echo ${{ steps.qemu.outputs.platforms }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ vars.DOCKER_FRANKENPHP_REPOSITORY_NAME }} + tags: | + type=raw,value=${{ matrix.frankenphp }}${{ matrix.php }}-xdebug-${{ matrix.distro }} + labels: | + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.description=Sylius FrankenPHP with XDebug ${{ matrix.frankenphp }}${{ matrix.php }} Docker image + org.opencontainers.image.licenses=MIT + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Cache Docker layers + uses: actions/cache@v4 + with: + path: /tmp/.buildx-cache + key: "${{ runner.os }}-frankenphp-${{ matrix.frankenphp }}${{ matrix.php }}-xdebug-${{ matrix.distro }}-buildx-cache-${{ vars.CACHE_VERSION }}-${{ steps.generate-uuid.outputs.uuid }}" + # https://github.com/actions/cache/issues/109#issuecomment-558771281 + # https://github.community/t/always-save-new-cache-for-incremental-builds/172791 + restore-keys: "${{ runner.os }}-frankenphp-${{ matrix.frankenphp }}${{ matrix.php }}-xdebug-${{ matrix.distro }}-buildx-cache-${{ vars.CACHE_VERSION }}-" + + - name: Docker Login + uses: docker/login-action@v3 + with: + registry: ${{ secrets.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_REPOSITORY_LOGIN }} + password: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }} + logout: true + + - name: Build and push + uses: docker/build-push-action@v5.0.0 + with: + file: ./frankenphp/Dockerfile + context: ./frankenphp + build-args: "FRANKENPHP_VERSION=${{ matrix.frankenphp }}${{ matrix.php }}-${{ matrix.distro }}" + platforms: linux/amd64,linux/arm64 + push: ${{ github.ref == 'refs/heads/frankenphp' || github.ref == 'refs/heads/main' || github.event_name == 'release' }} + pull: true + tags: ${{ steps.meta.outputs.tags }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new + target: "frankenphp_dev" + + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/frankenphp/BUILD b/frankenphp/BUILD new file mode 100644 index 0000000..3a26940 --- /dev/null +++ b/frankenphp/BUILD @@ -0,0 +1,16 @@ +load("@io_bazel_rules_docker//container:import.bzl", "container_import") +load("@io_bazel_rules_docker//contrib:test.bzl", "container_test") +load(":frankenphp-arch.bzl", "ARCHITECTURES") +load(":php-version.bzl", "PHP_VERSION") + +package(default_visibility = ["//visibility:public"]) + +[ + container_test( + name = "frankenphp-php" + PHP_VERSION + "_" + arch + "_test", + size = "medium", + configs = ["testdata/frankenphp-php" + PHP_VERSION + "_" + arch + ".yaml"], + image = "@image" + arch + "//image", + ) + for arch in ARCHITECTURES +] diff --git a/frankenphp/Dockerfile b/frankenphp/Dockerfile new file mode 100644 index 0000000..ed58d4d --- /dev/null +++ b/frankenphp/Dockerfile @@ -0,0 +1,62 @@ +#syntax=docker/dockerfile:1 +ARG FRANKENPHP_VERSION=1.5-php8.2-alpine + +# Adapted from https://github.com/dunglas/symfony-docker + +# Versions +FROM dunglas/frankenphp:${FRANKENPHP_VERSION} AS frankenphp_upstream + + +# Base FrankenPHP image +FROM frankenphp_upstream AS frankenphp_base + +WORKDIR /srv/sylius + +# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser +ENV COMPOSER_ALLOW_SUPERUSER=1 + +# persistent / runtime deps +# hadolint ignore=DL3008 +RUN install-php-extensions \ + @composer \ + apcu \ + exif \ + gd \ + intl \ + pdo_mysql \ + opcache \ + zip + +COPY --link conf.d/app.ini $PHP_INI_DIR/conf.d/ +COPY --link conf.d/app-cli.ini $PHP_INI_DIR/conf.d/ + +HEALTHCHECK --start-period=60s CMD curl -f http://localhost:2019/metrics || exit 1 +CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile" ] + +# Dev FrankenPHP image +FROM frankenphp_base AS frankenphp_dev + +ENV APP_ENV=dev XDEBUG_MODE=off +VOLUME /app/var/ + +RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" + +RUN set -eux; \ + install-php-extensions \ + xdebug \ + ; + +COPY --link conf.d/app.dev.ini $PHP_INI_DIR/conf.d/ + +CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ] + +# Prod FrankenPHP image +FROM frankenphp_base AS frankenphp_prod + +ENV APP_ENV=prod +ENV FRANKENPHP_CONFIG="import worker.Caddyfile" + +RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" + +COPY --link conf.d/app.prod.ini $PHP_INI_DIR/conf.d/ +COPY --link worker.Caddyfile /etc/caddy/worker.Caddyfile diff --git a/frankenphp/conf.d/app-cli.ini b/frankenphp/conf.d/app-cli.ini new file mode 100644 index 0000000..0e2579e --- /dev/null +++ b/frankenphp/conf.d/app-cli.ini @@ -0,0 +1,16 @@ +apc.enable_cli = 1 +date.timezone = ${PHP_DATE_TIMEZONE} +opcache.enable_cli = 1 +session.auto_start = Off +short_open_tag = Off + +# http://symfony.com/doc/current/performance.html +opcache.interned_strings_buffer = 16 +opcache.max_accelerated_files = 20000 +opcache.memory_consumption = 256 +realpath_cache_size = 4096K +realpath_cache_ttl = 600 + +memory_limit = 3G +post_max_size = 6M +upload_max_filesize = 5M diff --git a/frankenphp/conf.d/app.dev.ini b/frankenphp/conf.d/app.dev.ini new file mode 100644 index 0000000..52bcb29 --- /dev/null +++ b/frankenphp/conf.d/app.dev.ini @@ -0,0 +1,5 @@ +; See https://docs.docker.com/desktop/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host +; See https://github.com/docker/for-linux/issues/264 +; The `client_host` below may optionally be replaced with `discover_client_host=yes` +; Add `start_with_request=yes` to start debug session on each request +xdebug.client_host = xdebug://gateway diff --git a/frankenphp/conf.d/app.ini b/frankenphp/conf.d/app.ini new file mode 100644 index 0000000..dd08e3b --- /dev/null +++ b/frankenphp/conf.d/app.ini @@ -0,0 +1,15 @@ +apc.enable_cli = 1 +date.timezone = ${PHP_DATE_TIMEZONE} +opcache.enable_cli = 1 +session.auto_start = Off +short_open_tag = Off + +# http://symfony.com/doc/current/performance.html +opcache.interned_strings_buffer = 16 +opcache.max_accelerated_files = 20000 +opcache.memory_consumption = 256 +realpath_cache_size = 4096K +realpath_cache_ttl = 600 + +post_max_size = 6M +upload_max_filesize = 5M diff --git a/frankenphp/conf.d/app.prod.ini b/frankenphp/conf.d/app.prod.ini new file mode 100644 index 0000000..4df4f62 --- /dev/null +++ b/frankenphp/conf.d/app.prod.ini @@ -0,0 +1 @@ +opcache.preload_user = root diff --git a/frankenphp/testdata/frankenphp-php8.2_amd64.yaml b/frankenphp/testdata/frankenphp-php8.2_amd64.yaml new file mode 100644 index 0000000..c42da35 --- /dev/null +++ b/frankenphp/testdata/frankenphp-php8.2_amd64.yaml @@ -0,0 +1,71 @@ +schemaVersion: "1.0.0" +fileExistenceTests: + - name: php executable + path: '/usr/local/bin/php' + shouldExist: true + - name: 'Composer 755' + path: '/usr/local/bin/composer' + shouldExist: true + permissions: '-rwxr-xr-x' + - name: 'PHP Entry point 755' + path: '/usr/local/bin/docker-php-entrypoint' + shouldExist: true + permissions: '-rwxr-xr-x' +commandTests: + - name: arch + command: [ "uname", "-m" ] + expectedOutput: [ "x86_64" ] + - name: php-cli version + command: [ "/usr/local/bin/php", "--version" ] + expectedOutput: [ "PHP 8.2" ] + - name: config-files + command: [ "/usr/local/bin/php", "--ini" ] + expectedOutput: + - '/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-exif.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-gd.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-intl.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-zip.ini' + - name: php-cli extensions + command: [ "/usr/local/bin/php", "-m" ] + expectedOutput: + - 'apcu' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' diff --git a/frankenphp/testdata/frankenphp-php8.2_arm64.yaml b/frankenphp/testdata/frankenphp-php8.2_arm64.yaml new file mode 100644 index 0000000..afa493b --- /dev/null +++ b/frankenphp/testdata/frankenphp-php8.2_arm64.yaml @@ -0,0 +1,71 @@ +schemaVersion: "1.0.0" +fileExistenceTests: + - name: php executable + path: '/usr/local/bin/php' + shouldExist: true + - name: 'Composer 755' + path: '/usr/local/bin/composer' + shouldExist: true + permissions: '-rwxr-xr-x' + - name: 'PHP Entry point 755' + path: '/usr/local/bin/docker-php-entrypoint' + shouldExist: true + permissions: '-rwxr-xr-x' +commandTests: + - name: arch + command: [ "uname", "-m" ] + expectedOutput: [ "aarch64" ] + - name: php-cli version + command: [ "/usr/local/bin/php", "--version" ] + expectedOutput: [ "PHP 8.2" ] + - name: config-files + command: [ "/usr/local/bin/php", "--ini" ] + expectedOutput: + - '/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-exif.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-gd.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-intl.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-zip.ini' + - name: php-cli extensions + command: [ "/usr/local/bin/php", "-m" ] + expectedOutput: + - 'apcu' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' diff --git a/frankenphp/testdata/frankenphp-php8.3_amd64.yaml b/frankenphp/testdata/frankenphp-php8.3_amd64.yaml new file mode 100644 index 0000000..8b682db --- /dev/null +++ b/frankenphp/testdata/frankenphp-php8.3_amd64.yaml @@ -0,0 +1,71 @@ +schemaVersion: "1.0.0" +fileExistenceTests: + - name: php executable + path: '/usr/local/bin/php' + shouldExist: true + - name: 'Composer 755' + path: '/usr/local/bin/composer' + shouldExist: true + permissions: '-rwxr-xr-x' + - name: 'PHP Entry point 755' + path: '/usr/local/bin/docker-php-entrypoint' + shouldExist: true + permissions: '-rwxr-xr-x' +commandTests: + - name: arch + command: [ "uname", "-m" ] + expectedOutput: [ "x86_64" ] + - name: php-cli version + command: [ "/usr/local/bin/php", "--version" ] + expectedOutput: [ "PHP 8.3" ] + - name: config-files + command: [ "/usr/local/bin/php", "--ini" ] + expectedOutput: + - '/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-exif.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-gd.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-intl.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-zip.ini' + - name: php-cli extensions + command: [ "/usr/local/bin/php", "-m" ] + expectedOutput: + - 'apcu' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' diff --git a/frankenphp/testdata/frankenphp-php8.3_arm64.yaml b/frankenphp/testdata/frankenphp-php8.3_arm64.yaml new file mode 100644 index 0000000..d4ca9fb --- /dev/null +++ b/frankenphp/testdata/frankenphp-php8.3_arm64.yaml @@ -0,0 +1,71 @@ +schemaVersion: "1.0.0" +fileExistenceTests: + - name: php executable + path: '/usr/local/bin/php' + shouldExist: true + - name: 'Composer 755' + path: '/usr/local/bin/composer' + shouldExist: true + permissions: '-rwxr-xr-x' + - name: 'PHP Entry point 755' + path: '/usr/local/bin/docker-php-entrypoint' + shouldExist: true + permissions: '-rwxr-xr-x' +commandTests: + - name: arch + command: [ "uname", "-m" ] + expectedOutput: [ "aarch64" ] + - name: php-cli version + command: [ "/usr/local/bin/php", "--version" ] + expectedOutput: [ "PHP 8.3" ] + - name: config-files + command: [ "/usr/local/bin/php", "--ini" ] + expectedOutput: + - '/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-exif.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-gd.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-intl.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-zip.ini' + - name: php-cli extensions + command: [ "/usr/local/bin/php", "-m" ] + expectedOutput: + - 'apcu' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' diff --git a/frankenphp/testdata/frankenphp-php8.4_amd64.yaml b/frankenphp/testdata/frankenphp-php8.4_amd64.yaml new file mode 100644 index 0000000..44e8ecf --- /dev/null +++ b/frankenphp/testdata/frankenphp-php8.4_amd64.yaml @@ -0,0 +1,71 @@ +schemaVersion: "1.0.0" +fileExistenceTests: + - name: php executable + path: '/usr/local/bin/php' + shouldExist: true + - name: 'Composer 755' + path: '/usr/local/bin/composer' + shouldExist: true + permissions: '-rwxr-xr-x' + - name: 'PHP Entry point 755' + path: '/usr/local/bin/docker-php-entrypoint' + shouldExist: true + permissions: '-rwxr-xr-x' +commandTests: + - name: arch + command: [ "uname", "-m" ] + expectedOutput: [ "x86_64" ] + - name: php-cli version + command: [ "/usr/local/bin/php", "--version" ] + expectedOutput: [ "PHP 8.4" ] + - name: config-files + command: [ "/usr/local/bin/php", "--ini" ] + expectedOutput: + - '/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-exif.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-gd.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-intl.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-zip.ini' + - name: php-cli extensions + command: [ "/usr/local/bin/php", "-m" ] + expectedOutput: + - 'apcu' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' diff --git a/frankenphp/testdata/frankenphp-php8.4_arm64.yaml b/frankenphp/testdata/frankenphp-php8.4_arm64.yaml new file mode 100644 index 0000000..d53c0f3 --- /dev/null +++ b/frankenphp/testdata/frankenphp-php8.4_arm64.yaml @@ -0,0 +1,71 @@ +schemaVersion: "1.0.0" +fileExistenceTests: + - name: php executable + path: '/usr/local/bin/php' + shouldExist: true + - name: 'Composer 755' + path: '/usr/local/bin/composer' + shouldExist: true + permissions: '-rwxr-xr-x' + - name: 'PHP Entry point 755' + path: '/usr/local/bin/docker-php-entrypoint' + shouldExist: true + permissions: '-rwxr-xr-x' +commandTests: + - name: arch + command: [ "uname", "-m" ] + expectedOutput: [ "aarch64" ] + - name: php-cli version + command: [ "/usr/local/bin/php", "--version" ] + expectedOutput: [ "PHP 8.4" ] + - name: config-files + command: [ "/usr/local/bin/php", "--ini" ] + expectedOutput: + - '/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-exif.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-gd.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-intl.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-zip.ini' + - name: php-cli extensions + command: [ "/usr/local/bin/php", "-m" ] + expectedOutput: + - 'apcu' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' diff --git a/frankenphp/worker.Caddyfile b/frankenphp/worker.Caddyfile new file mode 100644 index 0000000..d384ae4 --- /dev/null +++ b/frankenphp/worker.Caddyfile @@ -0,0 +1,4 @@ +worker { + file ./public/index.php + env APP_RUNTIME Runtime\FrankenPhpSymfony\Runtime +}