Skip to content

Commit

Permalink
Merge pull request #19 from appwrite/feat-upgrade-to-php8-2
Browse files Browse the repository at this point in the history
Upgrade to PHP 8.2
  • Loading branch information
eldadfux authored Nov 2, 2023
2 parents aee71d0 + c5cb10a commit 340e545
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 40 deletions.
38 changes: 15 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.0.30-cli-alpine3.16 as compile
FROM php:8.2.6-cli-alpine3.18 as compile

ENV PHP_REDIS_VERSION="5.3.7" \
PHP_MONGODB_VERSION="1.16.1" \
Expand All @@ -14,6 +14,7 @@ ENV PHP_REDIS_VERSION="5.3.7" \

RUN \
apk add --no-cache --virtual .deps \
linux-headers \
make \
automake \
autoconf \
Expand Down Expand Up @@ -52,16 +53,6 @@ RUN \
make && make install && \
cd ..

## Swoole Debugger setup
RUN cd /tmp && \
apk add boost-dev && \
git clone --depth 1 https://github.com/swoole/yasd && \
cd yasd && \
phpize && \
./configure && \
make && make install && \
cd ..;

## Imagick Extension
FROM compile AS imagick
RUN \
Expand Down Expand Up @@ -145,7 +136,7 @@ RUN git clone --depth 1 https://github.com/DomBlack/php-scrypt.git \
&& ./configure --enable-scrypt \
&& make && make install

FROM php:8.0.30-cli-alpine3.16 as final
FROM php:8.2.6-cli-alpine3.18 as final

LABEL maintainer="[email protected]"

Expand All @@ -161,6 +152,7 @@ RUN set -ex \
RUN \
apk update \
&& apk add --no-cache --virtual .deps \
linux-headers \
make \
automake \
autoconf \
Expand Down Expand Up @@ -192,17 +184,17 @@ RUN \

WORKDIR /usr/src/code

COPY --from=swoole /usr/local/lib/php/extensions/no-debug-non-zts-20200930/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yasd.so* /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20200930/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=imagick /usr/local/lib/php/extensions/no-debug-non-zts-20200930/imagick.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=yaml /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yaml.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=maxmind /usr/local/lib/php/extensions/no-debug-non-zts-20200930/maxminddb.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=mongodb /usr/local/lib/php/extensions/no-debug-non-zts-20200930/mongodb.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=scrypt /usr/local/lib/php/extensions/no-debug-non-zts-20200930/scrypt.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=zstd /usr/local/lib/php/extensions/no-debug-non-zts-20200930/zstd.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=brotli /usr/local/lib/php/extensions/no-debug-non-zts-20200930/brotli.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=lz4 /usr/local/lib/php/extensions/no-debug-non-zts-20200930/lz4.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=snappy /usr/local/lib/php/extensions/no-debug-non-zts-20200930/snappy.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=swoole /usr/local/lib/php/extensions/no-debug-non-zts-20220829/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20220829/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=imagick /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=yaml /usr/local/lib/php/extensions/no-debug-non-zts-20220829/yaml.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=maxmind /usr/local/lib/php/extensions/no-debug-non-zts-20220829/maxminddb.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=mongodb /usr/local/lib/php/extensions/no-debug-non-zts-20220829/mongodb.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=scrypt /usr/local/lib/php/extensions/no-debug-non-zts-20220829/scrypt.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=zstd /usr/local/lib/php/extensions/no-debug-non-zts-20220829/zstd.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=brotli /usr/local/lib/php/extensions/no-debug-non-zts-20220829/brotli.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=lz4 /usr/local/lib/php/extensions/no-debug-non-zts-20220829/lz4.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=snappy /usr/local/lib/php/extensions/no-debug-non-zts-20220829/snappy.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/

# Enable Extensions
RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
Expand Down
31 changes: 14 additions & 17 deletions tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,37 @@ schemaVersion: '2.0.0'
fileExistenceTests:
## Extension files
- name: 'Check swoole extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/swoole.so
shouldExist: true
- name: 'Check swoole Debugger extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yasd.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/swoole.so
shouldExist: true
- name: 'Check redis extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/redis.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/redis.so
shouldExist: true
- name: 'Check imagick extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/imagick.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick.so
shouldExist: true
- name: 'Check yaml extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yaml.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/yaml.so
shouldExist: true
- name: 'Check maxminddb extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/maxminddb.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/maxminddb.so
shouldExist: true
- name: 'Check mongodb extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/mongodb.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/mongodb.so
shouldExist: true
- name: 'Check scrypt extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/scrypt.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/scrypt.so
shouldExist: true
- name: 'Check zstd extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/zstd.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/zstd.so
shouldExist: true
- name: 'Check brotli extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/brotli.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/brotli.so
shouldExist: true
- name: 'Check lz4 extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/lz4.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/lz4.so
shouldExist: true
- name: 'Check snappy extension'
path: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/snappy.so
path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/snappy.so
shouldExist: true

## ini files
Expand Down Expand Up @@ -107,19 +104,19 @@ commandTests:
- name: 'Imagemagick command'
command: "magick"
args: ["--version"]
expectedOutput: [".*ImageMagick 7.1.0-50.*"]
expectedOutput: [".*ImageMagick 7.1.*"]
- name: 'rsync command'
command: "rsync"
args: ["--version"]
expectedOutput: ["rsync version 3.*"]
- name: 'Certbot command'
command: "certbot"
args: ["--version"]
expectedOutput: ["certbot 1.*"]
expectedOutput: ["certbot 2.*"]
- name: 'Docker command'
command: "docker"
args: ["--version"]
expectedOutput: ["Docker version 20.*"]
expectedOutput: ["Docker version 23.*"]
- name: 'PHP info'
command: "php"
args: ["-m"]
Expand Down

0 comments on commit 340e545

Please sign in to comment.