-
Notifications
You must be signed in to change notification settings - Fork 113
/
Dockerfile
32 lines (30 loc) · 1.54 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM php:8.1.18-cli-alpine3.16
RUN \
set -ex && \
curl -sfL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
chmod +x /usr/bin/composer && \
composer self-update --clean-backups 2.5.5 && \
apk update && \
apk add --no-cache libstdc++ libpq && \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS curl-dev postgresql-dev openssl-dev pcre-dev pcre2-dev zlib-dev && \
# PHP extension pdo_mysql is included since 4.8.12+ and 5.0.1+.
docker-php-ext-install pdo_mysql && \
pecl channel-update pecl.php.net && \
pecl install --configureoptions 'enable-redis-igbinary="no" enable-redis-lzf="no" enable-redis-zstd="no"' redis-5.3.7 && \
# PHP extension Redis is included since 4.8.12+ and 5.0.1+.
docker-php-ext-enable redis && \
docker-php-ext-install sockets && \
docker-php-source extract && \
mkdir /usr/src/php/ext/swoole && \
curl -sfL https://github.com/swoole/swoole-src/archive/v5.0.3.tar.gz -o swoole.tar.gz && \
tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
docker-php-ext-configure swoole \
--enable-mysqlnd \
--enable-swoole-pgsql \
--enable-openssl \
--enable-sockets --enable-swoole-curl && \
docker-php-ext-install -j$(nproc) swoole && \
rm -f swoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps
WORKDIR "/var/www/"