diff --git a/Dockerfile b/Dockerfile index cfa0102..4a70d1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,9 @@ ENV PHP_REDIS_VERSION="6.1.0" \ PHP_BROTLI_VERSION="0.15.0" \ PHP_SNAPPY_VERSION="c27f830dcfe6c41eb2619a374de10fd0597f4939" \ PHP_LZ4_VERSION="2f006c3e4f1fb3a60d2656fc164f9ba26b71e995" \ - PHP_XDEBUG_VERSION="3.3.2" + PHP_XDEBUG_VERSION="3.3.2" \ + PHP_OPENTELEMETRY_VERSION="1.1.0" \ + PHP_PROTOBUF_VERSION="4.28.3" RUN \ apk add --no-cache --virtual .deps \ @@ -31,6 +33,8 @@ RUN \ imagemagick-dev \ libjpeg-turbo-dev \ jpeg-dev \ + zlib-dev \ + libpng-dev \ libjxl-dev \ libmaxminddb-dev \ zstd-dev \ @@ -151,6 +155,15 @@ RUN \ ./configure && \ make && make install +FROM compile AS opentelemetry +RUN pecl install opentelemetry-${PHP_OPENTELEMETRY_VERSION} + +FROM compile AS protobuf +RUN pecl install protobuf-${PHP_PROTOBUF_VERSION} + +FROM compile AS gd +RUN docker-php-ext-install gd + FROM $BASEIMAGE as final LABEL maintainer="team@appwrite.io" @@ -188,6 +201,8 @@ RUN \ libavif \ libheif \ imagemagick-heic \ + zlib-dev \ + libpng-dev \ libmaxminddb-dev \ certbot \ docker-cli \ @@ -217,18 +232,12 @@ COPY --from=brotli /usr/local/lib/php/extensions/no-debug-non-zts-20230831/brotl COPY --from=lz4 /usr/local/lib/php/extensions/no-debug-non-zts-20230831/lz4.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ COPY --from=snappy /usr/local/lib/php/extensions/no-debug-non-zts-20230831/snappy.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ COPY --from=xdebug /usr/local/lib/php/extensions/no-debug-non-zts-20230831/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ +COPY --from=opentelemetry /usr/local/lib/php/extensions/no-debug-non-zts-20230831/opentelemetry.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ +COPY --from=protobuf /usr/local/lib/php/extensions/no-debug-non-zts-20230831/protobuf.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ +COPY --from=gd /usr/local/lib/php/extensions/no-debug-non-zts-20230831/gd.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ # Enable Extensions -RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini -RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini -RUN echo extension=imagick.so >> /usr/local/etc/php/conf.d/imagick.ini -RUN echo extension=yaml.so >> /usr/local/etc/php/conf.d/yaml.ini -RUN echo extension=maxminddb.so >> /usr/local/etc/php/conf.d/maxminddb.ini -RUN echo extension=scrypt.so >> /usr/local/etc/php/conf.d/scrypt.ini -RUN echo extension=zstd.so >> /usr/local/etc/php/conf.d/zstd.ini -RUN echo extension=brotli.so >> /usr/local/etc/php/conf.d/brotli.ini -RUN echo extension=lz4.so >> /usr/local/etc/php/conf.d/lz4.ini -RUN echo extension=snappy.so >> /usr/local/etc/php/conf.d/snappy.ini +RUN docker-php-ext-enable swoole redis imagick yaml maxminddb scrypt zstd brotli lz4 snappy opentelemetry protobuf gd EXPOSE 80 diff --git a/tests.yaml b/tests.yaml index 6ac93f1..7f2e8c9 100644 --- a/tests.yaml +++ b/tests.yaml @@ -1,104 +1,4 @@ schemaVersion: '2.0.0' - -fileExistenceTests: - ## Extension files - - name: 'Check swoole extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/swoole.so - shouldExist: true - - name: 'Check redis extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/redis.so - shouldExist: true - - name: 'Check imagick extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/imagick.so - shouldExist: true - - name: 'Check yaml extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/yaml.so - shouldExist: true - - name: 'Check maxminddb extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/maxminddb.so - shouldExist: true - - name: 'Check mongodb extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/mongodb.so - shouldExist: true - - name: 'Check scrypt extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/scrypt.so - shouldExist: true - - name: 'Check zstd extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/zstd.so - shouldExist: true - - name: 'Check brotli extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/brotli.so - shouldExist: true - - name: 'Check lz4 extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/lz4.so - shouldExist: true - - name: 'Check snappy extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/snappy.so - shouldExist: true - - ## ini files - - name: 'Check swoole ini' - path: /usr/local/etc/php/conf.d/swoole.ini - shouldExist: true - - name: 'Check redis ini' - path: /usr/local/etc/php/conf.d/redis.ini - shouldExist: true - - name: 'Check imagick ini' - path: /usr/local/etc/php/conf.d/imagick.ini - shouldExist: true - - name: 'Check yaml ini' - path: /usr/local/etc/php/conf.d/yaml.ini - shouldExist: true - - name: 'Check maxminddb ini' - path: /usr/local/etc/php/conf.d/maxminddb.ini - shouldExist: true - - name: 'Check scrypt ini' - path: /usr/local/etc/php/conf.d/scrypt.ini - shouldExist: true - - name: 'Check zstd ini' - path: /usr/local/etc/php/conf.d/zstd.ini - shouldExist: true - - name: 'Check brotli ini' - path: /usr/local/etc/php/conf.d/brotli.ini - shouldExist: true - - name: 'Check lz4 ini' - path: /usr/local/etc/php/conf.d/lz4.ini - shouldExist: true - - name: 'Check snappy ini' - path: /usr/local/etc/php/conf.d/snappy.ini - shouldExist: true - -fileContentTests: - - name: 'swoole ini' - path: '/usr/local/etc/php/conf.d/swoole.ini' - expectedContents: ['extension=swoole.so'] - - name: 'redis ini' - path: '/usr/local/etc/php/conf.d/redis.ini' - expectedContents: ['extension=redis.so'] - - name: 'imagick ini' - path: '/usr/local/etc/php/conf.d/imagick.ini' - expectedContents: ['extension=imagick.so'] - - name: 'yaml ini' - path: '/usr/local/etc/php/conf.d/yaml.ini' - expectedContents: ['extension=yaml.so'] - - name: 'maxminddb ini' - path: '/usr/local/etc/php/conf.d/maxminddb.ini' - expectedContents: ['extension=maxminddb.so'] - - name: 'scrypt ini' - path: '/usr/local/etc/php/conf.d/scrypt.ini' - expectedContents: ['extension=scrypt.so'] - - name: 'zstd ini' - path: '/usr/local/etc/php/conf.d/zstd.ini' - expectedContents: ['extension=zstd.so'] - - name: 'brotli ini' - path: '/usr/local/etc/php/conf.d/brotli.ini' - expectedContents: ['extension=brotli.so'] - - name: 'lz4 ini' - path: '/usr/local/etc/php/conf.d/lz4.ini' - expectedContents: ['extension=lz4.so'] - - name: 'snappy ini' - path: '/usr/local/etc/php/conf.d/snappy.ini' - expectedContents: ['extension=snappy.so'] commandTests: - name: 'Imagemagick command' @@ -121,21 +21,58 @@ commandTests: command: "php" args: ["-m"] expectedOutput: - - ".*imagick.*" - - ".*maxminddb.*" - - ".*swoole.*" - - ".*redis.*" - - ".*yaml.*" - - ".*scrypt.*" - - ".*curl.*" - - ".*PDO.*" - - ".*pdo_mysql.*" - - ".*zstd.*" - - ".*brotli.*" - - ".*lz4.*" - - ".*snappy.*" + - brotli + - Core + - ctype + - curl + - date + - dom + - fileinfo + - filter + - gd + - hash + - iconv + - imagick + - intl + - json + - libxml + - lz4 + - maxminddb + - mbstring + - mysqlnd + - openssl + - opentelemetry + - pcre + - PDO + - pdo_mysql + - pdo_pgsql + - pdo_sqlite + - Phar + - posix + - protobuf + - random + - readline + - redis + - Reflection + - scrypt + - session + - SimpleXML + - snappy + - sockets + - sodium + - SPL + - sqlite3 + - standard + - swoole + - tokenizer + - xml + - xmlreader + - xmlwriter + - yaml + - zlib + - zstd - name: 'PHP intl' command: "php" args: ["-r", 'print(\Normalizer::FORM_D);'] expectedOutput: - - "4" \ No newline at end of file + - "4"