Skip to content

Commit 5c89b39

Browse files
authored
Merge pull request #812 from utopia-php/fix-mongo-relationships
Fix mongo relationships
2 parents 1530a1c + df5bce7 commit 5c89b39

File tree

3 files changed

+216
-51
lines changed

3 files changed

+216
-51
lines changed

Dockerfile

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

15-
FROM php:8.3.19-cli-alpine3.21 AS compile
15+
FROM php:8.4.18-cli-alpine3.22 AS compile
1616

17-
ENV PHP_REDIS_VERSION="6.0.2" \
18-
PHP_SWOOLE_VERSION="v5.1.7" \
17+
ENV PHP_REDIS_VERSION="6.3.0" \
18+
PHP_SWOOLE_VERSION="v6.1.6" \
1919
PHP_XDEBUG_VERSION="3.4.2" \
2020
PHP_MONGODB_VERSION="2.1.1"
2121
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2222

2323
RUN apk update && apk add --no-cache \
24-
postgresql-libs \
25-
postgresql-dev \
24+
libpq \
25+
libpq-dev \
2626
make \
2727
automake \
2828
autoconf \
@@ -33,10 +33,19 @@ RUN apk update && apk add --no-cache \
3333
linux-headers \
3434
docker-cli \
3535
docker-cli-compose \
36-
&& pecl install mongodb-$PHP_MONGODB_VERSION \
36+
&& (pecl install mongodb-$PHP_MONGODB_VERSION \
37+
|| (git clone --depth 1 --branch $PHP_MONGODB_VERSION --recurse-submodules https://github.com/mongodb/mongo-php-driver.git /tmp/mongodb \
38+
&& cd /tmp/mongodb \
39+
&& git submodule update --init --recursive \
40+
&& phpize \
41+
&& ./configure \
42+
&& make \
43+
&& make install \
44+
&& cd / \
45+
&& rm -rf /tmp/mongodb)) \
3746
&& docker-php-ext-enable mongodb \
3847
&& docker-php-ext-install opcache pgsql pdo_mysql pdo_pgsql \
39-
&& apk del postgresql-dev \
48+
&& apk del libpq-dev \
4049
&& rm -rf /var/cache/apk/*
4150

4251
# Redis Extension
@@ -96,10 +105,10 @@ RUN echo "opcache.enable_cli=1" >> $PHP_INI_DIR/php.ini
96105
RUN echo "memory_limit=1024M" >> $PHP_INI_DIR/php.ini
97106

98107
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
99-
COPY --from=swoole /usr/local/lib/php/extensions/no-debug-non-zts-20230831/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/
100-
COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20230831/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/
101-
COPY --from=pcov /usr/local/lib/php/extensions/no-debug-non-zts-20230831/pcov.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/
102-
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/
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/
110+
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/
103112

104113
COPY ./bin /usr/src/code/bin
105114
COPY ./src /usr/src/code/src
@@ -109,6 +118,6 @@ COPY ./dev /usr/src/code/dev
109118
RUN if [ "$DEBUG" = "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
110119
RUN if [ "$DEBUG" = "true" ]; then mkdir -p /tmp/xdebug; fi
111120
RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi
112-
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so; fi
121+
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20240924/xdebug.so; fi
113122

114123
CMD [ "tail", "-f", "/dev/null" ]

0 commit comments

Comments
 (0)