-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.alpine.twig
26 lines (24 loc) · 1.57 KB
/
Dockerfile.alpine.twig
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
FROM php:{{ php_version }}-cli-alpine{{ alpine_version }}
RUN \
curl -sfL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
chmod +x /usr/bin/composer && \
composer self-update --clean-backups {{ composer.version }} && \
apk update && \
apk add --no-cache linux-headers && \
apk add --no-cache libstdc++ {% if option_postgres == true %}postgresql-dev libpq {% endif %}&& \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS {% if option_curl == true %}curl-dev {% endif %}openssl-dev pcre-dev pcre2-dev zlib-dev && \
docker-php-ext-install sockets && \
docker-php-source extract && \
mkdir /usr/src/php/ext/openswoole && \
curl -sfL https://github.com/openswoole/ext-openswoole/archive/{% if swoole_version == "latest" %}{{ latest_version }}{% else %}v{{ swoole_version }}{% endif %}.tar.gz -o openswoole.tar.gz && \
tar xfz openswoole.tar.gz --strip-components=1 -C /usr/src/php/ext/openswoole && \
docker-php-ext-configure openswoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets {% if option_curl == true %}--enable-hook-curl {% endif %}{% if option_postgres == true %}--with-postgres {% endif %}&& \
docker-php-ext-install -j$(nproc) --ini-name zzz-docker-php-ext-openswoole.ini openswoole && \
rm -f openswoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps
WORKDIR "/var/www/"