Skip to content

Commit 2aa26e6

Browse files
abnegateclaude
andcommitted
fix: Revert Dockerfile to use php:8.4-cli-alpine base image
The utopia-php/base:php-8.4-0.2.1 image doesn't exist on Docker Hub, causing the CI Docker build to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e7bd2da commit 2aa26e6

1 file changed

Lines changed: 41 additions & 2 deletions

File tree

Dockerfile

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ RUN composer install \
1212
--no-scripts \
1313
--prefer-dist
1414

15-
FROM utopia-php/base:php-8.4-0.2.1 AS compile
15+
FROM php:8.4.18-cli-alpine3.22 AS compile
1616

17-
ENV PHP_MONGODB_VERSION="2.1.1"
17+
ENV PHP_REDIS_VERSION="6.3.0" \
18+
PHP_SWOOLE_VERSION="v6.1.6" \
19+
PHP_XDEBUG_VERSION="3.4.2" \
20+
PHP_MONGODB_VERSION="2.1.1"
21+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
1822

1923
RUN apk update && apk add --no-cache \
2024
libpq \
@@ -24,6 +28,8 @@ RUN apk update && apk add --no-cache \
2428
autoconf \
2529
gcc \
2630
g++ \
31+
git \
32+
brotli-dev \
2733
linux-headers \
2834
docker-cli \
2935
docker-cli-compose \
@@ -42,6 +48,24 @@ RUN apk update && apk add --no-cache \
4248
&& apk del libpq-dev \
4349
&& rm -rf /var/cache/apk/*
4450

51+
# Redis Extension
52+
FROM compile AS redis
53+
RUN \
54+
git clone --depth 1 --branch $PHP_REDIS_VERSION https://github.com/phpredis/phpredis.git \
55+
&& cd phpredis \
56+
&& phpize \
57+
&& ./configure \
58+
&& make && make install
59+
60+
## Swoole Extension
61+
FROM compile AS swoole
62+
RUN \
63+
git clone --depth 1 --branch $PHP_SWOOLE_VERSION https://github.com/swoole/swoole-src.git \
64+
&& cd swoole-src \
65+
&& phpize \
66+
&& ./configure --enable-http2 \
67+
&& make && make install
68+
4569
## PCOV Extension
4670
FROM compile AS pcov
4771
RUN \
@@ -51,6 +75,15 @@ RUN \
5175
&& ./configure --enable-pcov \
5276
&& make && make install
5377

78+
## XDebug Extension
79+
FROM compile AS xdebug
80+
RUN \
81+
git clone --depth 1 --branch $PHP_XDEBUG_VERSION https://github.com/xdebug/xdebug && \
82+
cd xdebug && \
83+
phpize && \
84+
./configure && \
85+
make && make install
86+
5487
FROM compile AS final
5588

5689
LABEL maintainer="team@appwrite.io"
@@ -60,7 +93,10 @@ ENV DEBUG=$DEBUG
6093

6194
WORKDIR /usr/src/code
6295

96+
RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
97+
RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
6398
RUN echo extension=pcov.so >> /usr/local/etc/php/conf.d/pcov.ini
99+
RUN echo extension=xdebug.so >> /usr/local/etc/php/conf.d/xdebug.ini
64100

65101
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
66102

@@ -69,7 +105,10 @@ RUN echo "opcache.enable_cli=1" >> $PHP_INI_DIR/php.ini
69105
RUN echo "memory_limit=1024M" >> $PHP_INI_DIR/php.ini
70106

71107
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
108+
COPY --from=swoole /usr/local/lib/php/extensions/no-debug-non-zts-20240924/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/
109+
COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20240924/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/
72110
COPY --from=pcov /usr/local/lib/php/extensions/no-debug-non-zts-20240924/pcov.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/
111+
COPY --from=xdebug /usr/local/lib/php/extensions/no-debug-non-zts-20240924/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/
73112

74113
COPY ./bin /usr/src/code/bin
75114
COPY ./src /usr/src/code/src

0 commit comments

Comments
 (0)